self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

TypeError when viewing some event transactions

Open Spikatrix opened this issue 4 months ago • 7 comments

Self-Hosted Version

25.7.0

CPU Architecture

x86_64

Docker Version

28.3.3

Docker Compose Version

2.39.1

Machine Specification

  • [x] My system meets the minimum system requirements of Sentry

Steps to Reproduce

I upgraded my self-hosted instance from 24.9.0 to 25.5.1, and then to 25.7.0.

Now, I'm unable to view some of the transactions from the discover page, both newly generated ones after the upgrade and some older ones. It however works for some transactions in there.

Expected Result

I'm able to view all transactions successfully.

Actual Result

Clicking on some transactions takes me to the view traces page (example). It shows a loader for a few seconds and then shows "Woof. We failed to load your trace. If you need to yell at someone, send feedback".

docker compose logs:

web-1    | 11:58:49 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.catchall.CatchallEndpoint' response=404 user_id='15' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/api/0/subscriptions/myorg/' caller_ip='<REDACTED_IP>' user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.01487278938293457 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
web-1    | 11:58:49 [WARNING] django.request: Not Found: /api/0/subscriptions/myorg/ (status_code=404 request=<WSGIRequest: GET '/api/0/subscriptions/myorg/'>)
nginx-1  | <REDACTED_IP> - - [04/Aug/2025:11:58:49 +0000] "GET /api/0/subscriptions/myorg/ HTTP/1.1" 404 0 "https://sentry.myorg.com/organizations/myorg/discover/trace/62921b5033514e6faadf1e5adcc433c3/?dataset=transactions&eventId=2da5179b60d949758028a6accf33ffa1&field=title&field=project&field=user.display&field=timestamp&id=6&name=&project=6&query=&queryDataset=transaction-like&sort=-timestamp&source=discover&statsPeriod=24h&timestamp=1754308636&topEvents=5&yAxis=count%28%29" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0" "<REDACTED_IP>"
web-1    | Traceback (most recent call last):
web-1    |   File "/usr/src/sentry/src/sentry/api/base.py", line 317, in handle_exception_with_details
web-1    |     response = self.handle_exception(exc)
web-1    |   File "/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 475, in handle_exception
web-1    |     self.raise_uncaught_exception(exc)
web-1    |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
web-1    |   File "/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 486, in raise_uncaught_exception
web-1    |     raise exc
web-1    |   File "/usr/src/sentry/src/sentry/api/base.py", line 431, in dispatch
web-1    |     response = handler(request, *args, **kwargs)
web-1    |   File "/usr/src/sentry/src/sentry/api/endpoints/organization_events_trace.py", line 900, in get
web-1    |     self.serialize(
web-1    |     ~~~~~~~~~~~~~~^
web-1    |         limit,
web-1    |         ^^^^^^
web-1    |     ...<6 lines>...
web-1    |         query_source=self.get_request_source(request),
web-1    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
web-1    |     )
web-1    |     ^
web-1    |   File "/usr/src/sentry/src/sentry/api/endpoints/organization_events_trace.py", line 1324, in serialize
web-1    |     self.update_children(subtrace, limit)
web-1    |     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
web-1    |   File "/usr/src/sentry/src/sentry/api/endpoints/organization_events_trace.py", line 1131, in update_children
web-1    |     parent.children.sort(key=child_sort_key)
web-1    |     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
web-1    | TypeError: '<' not supported between instances of 'str' and 'float'
web-1    | 11:58:50 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.organization_events_trace.OrganizationEventsTraceEndpoint' response=500 user_id='15' is_app='False' token_type='None' is_frontend_request='True' organization_id='1' auth_id='None' path='/api/0/organizations/myorg/events-trace/62921b5033514e6faadf1e5adcc433c3/' caller_ip='<REDACTED_IP>' user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.31406688690185547 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
web-1    | 11:58:50 [ERROR] django.request: Internal Server Error: /api/0/organizations/myorg/events-trace/62921b5033514e6faadf1e5adcc433c3/ (status_code=500 request=<WSGIRequest: GET '/api/0/organizations/myorg/events-trace/62921b5033514e6faadf1e5adcc433c3/?limit=10000&targetId=2da5179b60d949758028a6accf33ffa1&timestamp=1754308636'>)
nginx-1  | <REDACTED_IP> - - [04/Aug/2025:11:58:50 +0000] "GET /api/0/organizations/myorg/events-trace/62921b5033514e6faadf1e5adcc433c3/?limit=10000&targetId=2da5179b60d949758028a6accf33ffa1&timestamp=1754308636 HTTP/1.1" 500 72 "https://sentry.myorg.com/organizations/myorg/discover/trace/62921b5033514e6faadf1e5adcc433c3/?dataset=transactions&eventId=2da5179b60d949758028a6accf33ffa1&field=title&field=project&field=user.display&field=timestamp&id=6&name=&project=6&query=&queryDataset=transaction-like&sort=-timestamp&source=discover&statsPeriod=24h&timestamp=1754308636&topEvents=5&yAxis=count%28%29" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0" "<REDACTED_IP>"

Event ID

No response

Spikatrix avatar Aug 04 '25 12:08 Spikatrix

Do you have all the feature flags defined below on your sentry/sentry.conf.py file?

https://github.com/getsentry/self-hosted/blob/3f48e35813edf22ae8dee170ea6645900440b117/sentry/sentry.conf.example.py#L282-L347

aldy505 avatar Aug 05 '25 01:08 aldy505

@aldy505 Yes, I pretty much use the defaults

Spikatrix avatar Aug 05 '25 04:08 Spikatrix

Hi, can you try upgrading to 25.8.0?

aldy505 avatar Aug 19 '25 01:08 aldy505

I'll try it out soon. I'll also try switching back to rust-consumer as mentioned here and see if that helps

Spikatrix avatar Aug 25 '25 11:08 Spikatrix

I switched back to rust-consumers and upgraded to 25.8.0 but the issue still persists unfortunately.

Spikatrix avatar Sep 03 '25 06:09 Spikatrix

I am facing two issues

  1. In issues tabs, the transactions and spans are not visible. On checking the network request, it seems subscriptions api is faling. https://github.com/getsentry/sentry/issues/96077
  2. In transaction summary view, some api calls for project-transaction-thershold is returning 404 http error code

RahulLanjewar93 avatar Sep 17 '25 09:09 RahulLanjewar93

i use 25.9.0 ,I'm having the same issue.

Traceback (most recent call last): File "/usr/src/sentry/src/sentry/api/base.py", line 318, in handle_exception_with_details response = self.handle_exception(exc) File "/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 475, in handle_exception self.raise_uncaught_exception(exc) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^ File "/.venv/lib/python3.13/site-packages/rest_framework/views.py", line 486, in raise_uncaught_exception raise exc File "/usr/src/sentry/src/sentry/api/base.py", line 432, in dispatch response = handler(request, *args, **kwargs) File "/usr/src/sentry/src/sentry/api/endpoints/organization_events_trace.py", line 899, in get self.serialize( ~~~~~~~~~~~~~~^ limit, ^^^^^^ ...<6 lines>... query_source=self.get_request_source(request), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/sentry/src/sentry/api/endpoints/organization_events_trace.py", line 1325, in serialize trace_roots.sort(key=child_sort_key) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'str' and 'float'

xtyinbiao avatar Oct 21 '25 06:10 xtyinbiao