Hello,

On Fri, 20 Feb 2026 17:45:49 +0100 Gena Byers <[email protected]> 
wrote:
> On 2/20/26 5:22 PM, Andrej Shadura wrote:
> > Control: reassign -1 src:sentry-python
> > 
> > Hello,
> > 
> > On Fri, 20 Feb 2026, at 17:15, Gena Byers wrote:
> >> On 2/20/26 4:54 PM, Andrej Shadura wrote:
> >>> Can you give me more details please?
> >>> I don’t see any mentions of this anywhere in the source.
> > 
> >> I don't know what the exact mechanism is but installing python3-eventlet
> >> renders matrix-synapse inoperable:
> > 
> >> "/usr/lib/python3/dist-packages/sentry_sdk/utils.py", line 1346, in
> >> _get_contextvars
> >> Feb 20 16:59:17 nexus python3[2979902]:     if not 
> >> _is_contextvars_broken():
> >> Feb 20 16:59:17 nexus python3[2979902]:            ~~~~~~~~~~~~~~~~~~~~~~^^
> >> Feb 20 16:59:17 nexus python3[2979902]:   File
> >> "/usr/lib/python3/dist-packages/sentry_sdk/utils.py", line 1287, in
> >> _is_contextvars_broken
> >> Feb 20 16:59:17 nexus python3[2979902]:     from eventlet.patcher import
> >> is_monkey_patched  # type: ignore
> > 
> > Looks like something in the sentry SDK (which I think you should have 
> > mentioned you enabled).
> > 
> I do have python3-sentry-sdk installed because it's a dependency of an 
> unrelated package but I have no idea what that is or what I did to 
> "enable" it. Removing python3-sentry-sdk makes matrix-synapse work again 
> even with python3-eventlet installed so I guess both have to be 
> installed to trigger it.

I recently uploaded some new versions of sentry-python, can you please test 
this bug again?

For reference, I tested this bug very quickly here and couldn't reproduce it.

Sentry is only used in matrix-synapse if it is enabled in the config. 
Otherwise, it is not imported
at all: 
https://github.com/element-hq/synapse/blob/d7e9a3ff8321fa820f38c17a4484f0437233cebb/synapse/app/_base.py#L830

To "enable" sentry in matrix-synapse you need to have something like this in 
your
config (/etc/matrix-synapse/homeserver.yaml):

  sentry:
      environment: production
      dsn: '...'


AFAICT, the default configuration in Debian does NOT set the sentry 
configuration,
so by default really you shouldn't be hitting this path.

Can you check if you setup sentry at all in the synapse configuration?

I guess we should add python3-sentry-sdk as a runtime-dep to matrix-synapse as 
well, since it can be enabled at runtime.


Cheers!

Chris

Reply via email to