Skip to content

LookupError <ContextVar name='current_scope' default=None at 0x7f88232e1620> #4410

@DusanMadar

Description

@DusanMadar

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.13.0

Steps to Reproduce

Python 3.10
Django 4.2.20
Gunicorn 23.0.0

sentry_sdk.init(
    dsn=os.getenv("SENTRY_BE_DSN"),
    integrations=[DjangoIntegration(), RedisIntegration()],
    traces_sample_rate=0.0,
    send_default_pii=True,
    environment=os.getenv("APP_NAME"),
    release=os.getenv("COMMIT"),
)

Looks similar to #3724.

Expected Result

Exception is not raised.

Actual Result

Traceback (most recent call last):
  File "/app/.venv/python/lib/python3.10/site-packages/gunicorn/workers/gthread.py", line 346, in handle_request
    respiter.close()
  File "/app/.venv/python/lib/python3.10/site-packages/sentry_sdk/integrations/wsgi.py", line 235, in close
    with use_isolation_scope(self._scope):
  File "/app/.venv/python/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/app/.venv/python/lib/python3.10/site-packages/sentry_sdk/scope.py", line 1678, in use_isolation_scope
    _current_scope.reset(current_token)
LookupError: <ContextVar name='current_scope' default=None at 0x7f88232e1620>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy