Skip to content

get_event_stacktrace returns nothing for exception-only events #2144

Open

Description

@sentry-junior

For an event with an exception entry but no threads entry (the common case for Python and most server SDKs), get_event_stacktrace returns only "No thread stacktraces were found for this event." The exception stacktrace that is in the same event is not returned.

  • fetchAndFormatEventStacktrace reads only the threads entry and returns early when it is empty (packages/mcp-core/src/tools/support/event-stacktrace.ts:46-55, getThreads at :73-77).
  • The tool description scopes it to threads (packages/mcp-core/src/tools/catalog/get-event-stacktrace.ts:23-39), but nothing tells the agent that exception frames are only in get_issue_details / get_sentry_resource, so agents call it for exception events and get an empty answer.

Reported through MCP user feedback (MCP-SERVER-GN2) on a Python exception event. The call itself was not in sampled traces; the behavior is from the code path above.

via Sentry.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 10, 2026

    @linear-code
  2. launchforgedev commented on Nov 13, 2026

    @launchforgedev

    Hi! I'd like to work on this issue.

    I went through the reported behavior and plan to update the stacktrace extraction logic to handle exception-only events when the threads entry is absent or empty.

    I'll also add regression tests covering exception-only events, thread-based stacktraces, and events without any stacktrace data.

    Please let me know if there are any implementation considerations or preferred approaches before I start.

  3. sentry-junior commented on Nov 18, 2026

    @sentry-junior
    ContributorAuthor

    Another report hit this: MCP user feedback MCP-SERVER-GRJ (Android SIGABRT, native event). get_event_stacktrace returned no_threads (packages/mcp-core/src/tools/support/event-stacktrace.ts:99), so the agent couldn't get the crashing native stack from it. The broader native-diagnostics gap (debug images, frame addresses, native processing errors, signal) is tracked in #2357.

  4. sentry-junior commented on Nov 18, 2026

    @sentry-junior
    ContributorAuthor

    Related, separate path: MCP user feedback MCP-SERVER-GS8 hit get_event_stacktrace returning no_threads on native message events whose stack is in the event-level stacktrace entry, not exceptions or threads. That's tracked in #2401, and the draft fix in #2402 touches the same no_threads branch in packages/mcp-core/src/tools/support/event-stacktrace.ts. It doesn't return exception stacks, so this issue stays open. Anyone fixing this one should rebase on that PR to avoid a conflict.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions