Skip to content

withServerActionInstrumentation catches NEXT_REDIRECT and NEXT_NOT_FOUND errors #10466

Closed

Description

@ianschmitz

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.99.0

Framework Version

14.1.0

Link to Sentry event

https://yellowpad-tl.sentry.io/issues/4933611798/events/b027a0b732e44edfa4da10f4f6d528fa/?project=4506667113185280

SDK Setup

{
    dsn: "https://ab637fbc48e826363f3cc7fbb1e0fc68@o4506114868117504.ingest.sentry.io/4506667113185280",
    tracesSampleRate: 1,
    debug: false,
}

Steps to Reproduce

Create a server action with the following:

"use server";

import { withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";

export async function someAction() {
  return await withServerActionInstrumentation(
      "foo",
      { headers: headers() },
      async () => {
          redirect("/some-path");
      },
  );
}

Expected Result

These exceptions should not be caught as per #7641.

Actual Result

An error is logged in Sentry issues:

CleanShot 2024-02-01 at 11 13 21

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Feb 1, 2024
  2. lforst commented on Feb 2, 2024

    @lforst
    Contributor

    Ah right. Thanks for raising. This is an oversight but should be fixed easily. Backlogging!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Feb 2, 2024
  4. ishaangandhi commented on Apr 4, 2024

    @ishaangandhi

    What version of sentry do you have to have to no longer have this issue? I saw you completed this in #10474, but I am still running into this. I have 7.109.0.

  5. lforst commented on Apr 5, 2024

    @lforst
    Contributor

    @ishaangandhi would you mind creating a new issue with a reproduction example? Thank you!

  6. MisterJimson commented on May 17, 2024

    @MisterJimson

    I'm also seeing this still on newest v7 (7.116.0).

    Show's up in Spotlight as well during local dev. Working on a reprod but not reproducible in an isolated way yet.

  7. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions