Control: reassign -1 python3-eventlet
Control: affects -1 matrix-synapse python3-sentry-sdk
Control: found -1 0.40.4-1

On Fri, 2026-06-19 at 21:31 +0200, First name Last name wrote:
> On 13.06.26 4:07 AM, Christopher Obbard wrote:
> > 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
> 
> I don't have something like that in my configuration. Having both
> python3-sentry-sdk (2.60.0-3) and python3-eventlet (0.40.4-1) installed
> still renders matrix-synapse inoperable:

Thanks for the traceback - I can now reproduce this after installing 
python3-trio.

A minimal reproducer appears to be:

    apt install python3-sentry-sdk python3-eventlet python3-trio 
python3-dnspython python3-httpcore
    python3 -c 'import sentry_sdk'

which fails with:

    AttributeError: type object 'GreenSocket' has no attribute 'sendmsg'

The Synapse failure does not require Sentry to be configured. Synapse imports 
sentry_sdk during startup which causes the traceback.

Setting EVENTLET_NO_GREENDNS=yes avoids the crash:

    EVENTLET_NO_GREENDNS=yes python3 -c 'import sentry_sdk'

I get the same crash when just importing eventlet:

    python3 -c 'import eventlet'
    AttributeError: type object 'GreenSocket' has no attribute 'sendmsg'


This looks very similar to #1042466 but #1042466 the missing method is 
eventlet.green.select.epoll.
Here the missing method is eventlet.green.socket.GreenSocket.sendmsg so I won't 
merge the bugs yet.

Reassigning to python3-eventlet. @Thomas, could you take a look at this one?

Cheers!

Chris

Reply via email to