You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transaction status incorrectly reports 500 (internal_error) instead of actual HTTP status code (eg. 404) when Rails handles exceptions #2825
When Rails handles an exception internally and converts it to a specific HTTP status code (e.g., ActiveRecord::RecordNotFound -> 404), the Sentry transaction is incorrectly reported with status internal_error and http.response.status_code: 500 instead of the actual HTTP response status code.
This creates inaccurate reports, as all Rails-rescued exceptions appear as 500 errors in Sentry, even though the client receives the correct HTTP status code (404, 422, etc.).
The breadcrumbs in the transaction correctly show the actual status code (404), but the transaction-level status and span-level status codes are incorrect (500).
Even though version 6.0.0+ includes trace_ignore_status_codes which by default excludes 404s from being traced, this is a workaround rather than a fix. The underlying issue of incorrect status code reporting remains for any status codes that are not ignored.
Reproduction Steps
Configure a Rails application with sentry-rails version 5.27.0
Enable tracing with config.traces_sample_rate = 1.0
Create a route that raises ActiveRecord::RecordNotFound or similar exception that Rails rescues and converts to a 404 response
changed the title [-]Transaction status incorrectly reports 500 (internal_error) instead of actual HTTP status code (e.g., 404) when Rails handles exceptions[/-][+]Transaction status incorrectly reports 500 (internal_error) instead of actual HTTP status code (eg. 404) when Rails handles exceptions[/+]on Jan 8, 2026
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Activity
linear commentedon Jan 8, 2026
RUBY-137
[-]Transaction status incorrectly reports 500 (internal_error) instead of actual HTTP status code (e.g., 404) when Rails handles exceptions[/-][+]Transaction status incorrectly reports 500 (internal_error) instead of actual HTTP status code (eg. 404) when Rails handles exceptions[/+]sl0thentr0py commentedon Jan 8, 2026
Tried to reproduce but works correctly for me:
with this simple resource show and calling it with an unknown id
sl0thentr0py/sentry_sample_apps@9f6307a
getsantry commentedon Jan 30, 2026
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label
Waiting for: Community, I will leave it alone ... forever!"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
solnic commentedon Jan 30, 2026
@InterstellarStella could you share the version of Rails where this is happening?
InterstellarStella commentedon Feb 2, 2026
@solnic the Rails version is
8.1.1. Adding some links in the Linear ticket.solnic commentedon Feb 2, 2026
I think I reproduced it over here #2848 - @sl0thentr0py I'm happy to dig in, sounds good?