question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exiting `with push_scope()` fails if new client is bound

See original GitHub issue

Similarly to https://github.com/getsentry/sentry-python/issues/147, we started to get popped wrong scope assertion errors in a Falcon app sending jobs to redis-queue after updating to sentry-sdk from raven

Our Python 3.5.2 stack:

rq==0.12.0
redis==2.10.6
sentry-sdk==0.5.2

The worker is initialized like this:

    listen = [l.value for l in constants.QueueList]
    conn = redis.from_url(os.environ.get(
        'REDIS_WORKER', 'redis://redis_worker:6379'))

    sentry_sdk.init(sentry_key,
                    environment=environment,
                    release=release,
                    integrations=[RqIntegration()])
    with Connection(conn):
        worker = Worker(list(map(Queue, listen)))
        worker.work(logging_level='WARNING')

If it’s the same kind of issue, would a change from:

            with hub.push_scope() as scope:
                scope.add_event_processor(_make_event_processor(weakref.ref(job)))
                rv = old_perform_job(self, job, *args, **kwargs)

to

            with Hub(hub) as hub:
                with hub.configure_scope() as scope:
                    scope.add_event_processor(_make_event_processor(weakref.ref(job)))
                    rv = old_perform_job(self, job, *args, **kwargs)

in https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/rq.py#L28 do the job ?

If not, I’d be happy to provide more info

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
untitakercommented, Nov 5, 2018

Cool, I’ll just release the bugfix then.

0reactions
FelixLCcommented, Nov 5, 2018

Great ! I had prepared a small repo for you. Actually this line made me add an init in worker.py and I didn’t give much thought to the other init hidden in the startup code. If you put a warning it’s all right I think !

Read more comments on GitHub >

github_iconTop Results From Across the Web

sentry - Go Packages - The Go Programming Language
CaptureMessage calls the method of a same name on currently bound `Client` instance passing it a top-level `Scope`. Returns `EventID` if ...
Read more >
Critical Issues Addressed in PAN-OS Releases
Bugs Affected Platform(if any). /Affected Version Description (release note) PAN‑92564 8.0.0‑8.0‑8, 8.1.0 PAN‑86882 8.0.0‑8.0.7. and all older Mainlines PAN‑81990 PA‑5220,PA‑5250. /. 8.0.4 Multiple DP restarts by...
Read more >
Problems with TransactionScope and Oracle - Stack Overflow
MaximumTimeout property which is the upper bound of whatever you are ... one of these timeouts hits, a transaction yet to be Complete()...
Read more >
Scopes and Hubs for Python | Sentry Documentation
When you call init() a hub is created and a client and a blank scope are created ... all the context you have...
Read more >
Service Portal: Client and Server Side Buttons - ServiceNow
The form widget does a great job of taking user input and submitting it to the server when the Save/Update UI Actions are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found