Skip to content

Internal error showed up in my logs #4295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
offby1 opened this issue Apr 12, 2025 · 3 comments
Closed

Internal error showed up in my logs #4295

offby1 opened this issue Apr 12, 2025 · 3 comments

Comments

@offby1
Copy link

offby1 commented Apr 12, 2025

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Sorry, I cannot provide a repro scenario; I have no idea what triggered this.

All I can tell you is that I saw this in my logs:

django-1  | 2025-04-12T17:56:04+0000 ERROR request_id=none utils.py(232) capture_internal_exception Internal error in sentry_sdk
django-1  | Traceback (most recent call last):
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/sessions/backends/base.py", line 244, in _get_session
django-1  |     return self._session_cache
django-1  |            ^^^^^^^^^^^^^^^^^^^
django-1  | AttributeError: 'SessionStore' object has no attribute '_session_cache'
django-1  | 
django-1  | During handling of the above exception, another exception occurred:
django-1  | 
django-1  | Traceback (most recent call last):
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/sentry_sdk/integrations/django/asgi.py", line 77, in asgi_request_event_processor
django-1  |     _set_user_info(request, event)
django-1  |     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/sentry_sdk/integrations/django/__init__.py", line 597, in _set_user_info
django-1  |     if user is None or not is_authenticated(user):
django-1  |                            ~~~~~~~~~~~~~~~~^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/sentry_sdk/integrations/django/__init__.py", line 102, in is_authenticated
django-1  |     return request_user.is_authenticated
django-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/utils/functional.py", line 251, in inner
django-1  |     self._setup()
django-1  |     ~~~~~~~~~~~^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/utils/functional.py", line 404, in _setup
django-1  |     self._wrapped = self._setupfunc()
django-1  |                     ~~~~~~~~~~~~~~~^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/auth/middleware.py", line 39, in <lambda>
django-1  |     request.user = SimpleLazyObject(lambda: get_user(request))
django-1  |                                             ~~~~~~~~^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/auth/middleware.py", line 19, in get_user
django-1  |     request._cached_user = auth.get_user(request)
django-1  |                            ~~~~~~~~~~~~~^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/auth/__init__.py", line 304, in get_user
django-1  |     user_id = _get_user_session_key(request)
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/auth/__init__.py", line 95, in _get_user_session_key
django-1  |     return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])
django-1  |                                                ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/sessions/backends/base.py", line 55, in __getitem__
django-1  |     return self._session[key]
django-1  |            ^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/sessions/backends/base.py", line 249, in _get_session
django-1  |     self._session_cache = self.load()
django-1  |                           ~~~~~~~~~^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/sessions/backends/db.py", line 55, in load
django-1  |     s = self._get_session_from_db()
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/contrib/sessions/backends/db.py", line 34, in _get_session_from_db
django-1  |     return self.model.objects.get(
django-1  |            ~~~~~~~~~~~~~~~~~~~~~~^
django-1  |         session_key=self.session_key, expire_date__gt=timezone.now()
django-1  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django-1  |     )
django-1  |     ^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/manager.py", line 87, in manager_method
django-1  |     return getattr(self.get_queryset(), name)(*args, **kwargs)
django-1  |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django_fastdev/apps.py", line 404, in fast_dev_get
django-1  |     return orig_queryset_get(self, *args, **kwargs)
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/query.py", line 629, in get
django-1  |     num = len(clone)
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/query.py", line 366, in __len__
django-1  |     self._fetch_all()
django-1  |     ~~~~~~~~~~~~~~~^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/query.py", line 1935, in _fetch_all
django-1  |     self._result_cache = list(self._iterable_class(self))
django-1  |                          ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/query.py", line 91, in __iter__
django-1  |     results = compiler.execute_sql(
django-1  |         chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size
django-1  |     )
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/db/models/sql/compiler.py", line 1620, in execute_sql
django-1  |     cursor = self.connection.cursor()
django-1  |   File "/bridge/.venv/lib/python3.13/site-packages/django/utils/asyncio.py", line 24, in inner
django-1  |     raise SynchronousOnlyOperation(message)
django-1  | django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.

Expected Result

n/a

Actual Result

n/a

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

@getsantry
Copy link

getsantry bot commented Apr 12, 2025

Assigning to @getsentry/support for routing ⏲️

@getsantry getsantry bot moved this to Waiting for: Support in GitHub Issues with 👀 3 Apr 12, 2025
@cobyeastwood183 cobyeastwood183 transferred this issue from getsentry/sentry Apr 14, 2025
@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 14, 2025
@szokeasaurusrex
Copy link
Member

@offby1 what version of the Sentry SDK are you using?

If you are using a version between 2.23.0 and 2.25.1 (inclusive), then this issue is most likely a duplicate of #4266. If you are on one of those versions, please upgrade to version 2.26.0, which fixes the problem.

@offby1
Copy link
Author

offby1 commented Apr 15, 2025 via email

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants