-
Notifications
You must be signed in to change notification settings - Fork 558
Closed
Labels
Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.17.0
Steps to Reproduce
- Configure sentry_sdk with
before_send
andbefore_send_transaction
- Return
None
or crash inbefore_send
Expected Result
Error is ignored
Actual Result
Sentry crashes with a keyerror in an infinite loop.
....
....
....
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/wsgi.py", line 136, in __call__
rv = self.app(
File "/app/.venv/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 131, in __call__
response = self.get_response(request)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/django/__init__.py", line 417, in sentry_patched_get_response
rv = old_get_response(self, request)
File "/app/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 140, in get_response
response = self._middleware_chain(request)
File "/app/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 58, in inner
response = response_for_exception(request, exc)
File "/app/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 140, in response_for_exception
signals.got_request_exception.send(sender=None, request=request)
File "/app/.venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/app/.venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
(receiver, receiver(signal=self, sender=sender, **named))
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/django/signals_handlers.py", line 66, in wrapper
return receiver(*args, **kwargs)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/django/__init__.py", line 480, in _got_request_exception
hub.capture_event(event, hint=hint)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/hub.py", line 338, in capture_event
rv = client.capture_event(event, hint, scope)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/client.py", line 420, in capture_event
event_opt = self._prepare_event(event, hint, scope)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/client.py", line 276, in _prepare_event
if before_send_transaction is not None and event.get("type") == "transaction":
AttributeError: 'NoneType' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/orhan/.asdf/installs/python/3.10.10/lib/python3.10/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/django/__init__.py", line 137, in sentry_patched_wsgi_handler
return SentryWsgiMiddleware(bound_old_app, use_x_forwarded_for)(
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/wsgi.py", line 143, in __call__
reraise(*_capture_exception(hub))
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/integrations/wsgi.py", line 245, in _capture_exception
hub.capture_event(event, hint=hint)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/hub.py", line 338, in capture_event
rv = client.capture_event(event, hint, scope)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/client.py", line 420, in capture_event
event_opt = self._prepare_event(event, hint, scope)
File "/app/.venv/lib/python3.10/site-packages/sentry_sdk/client.py", line 276, in _prepare_event
if before_send_transaction is not None and event.get("type") == "transaction":
AttributeError: 'NoneType' object has no attribute 'get'