#1128500 matrix-synapse: fails to start when python3-eventlet is installed

#1128500#5
Date:
2026-02-20 15:50:34 UTC
From:
To:
Dear Maintainer,

matrix-synapse doesn't start when python3-eventlet is installed

#1128500#10
Date:
2026-02-20 15:54:59 UTC
From:
To:
Hello,

Can you give me more details please?
I don’t see any mentions of this anywhere in the source.

#1128500#15
Date:
2026-02-20 16:15:51 UTC
From:
To:
renders matrix-synapse inoperable:

$ sudo apt-get install python3-eventlet && sudo systemctl restart
matrix-synapse.service
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Solving dependencies... Done
The following packages were automatically installed and are no longer
required:
   linux-doc-6.16 linux-doc-6.17 linux-image-6.16.12+deb14+1-rt-amd64
linux-image-6.17.11+deb14-rt-amd64 linux-image-6.17.12+deb14-rt-amd64
   linux-image-6.17.13+deb14-rt-amd64 linux-image-6.17.8+deb14-rt-amd64
Use 'sudo apt autoremove' to remove them.
Suggested packages:
   python-eventlet-doc
The following NEW packages will be installed:
   python3-eventlet
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 311 kB of archives.
After this operation, 987 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian testing/main all python3-eventlet all
0.40.3-2 [311 kB]
Fetched 311 kB in 0s (1,948 kB/s)
Selecting previously unselected package python3-eventlet.
(Reading database… 1820926 files and directories currently installed.)
Preparing to unpack …/python3-eventlet_0.40.3-2_all.deb…
Unpacking python3-eventlet (0.40.3-2)…
Setting up python3-eventlet (0.40.3-2)…
Scanning processes...

Scanning candidates...

Scanning processor microcode...

Scanning linux images...


The processor microcode seems to be up-to-date.

Restarting services...
Service restarts being deferred:
  /etc/needrestart/restart.d/dbus.service
  systemctl restart nodm.service
  systemctl restart unattended-upgrades.service

No containers need to be restarted.

User sessions running outdated binaries:
  user @ session #2: bash[969641,2416463,2918488],
chromium[2918522,2918602], crashhelper[3589], firefox[3360],
forkserver[4282],
   glycin-svg[984474,984532], obsidian[3334,3482,3926], sh[2946],
urxvtd[3114,3115], x-session-manag[2982]
  user @ user manager: chromium[2918499], (sd-pam)[2625]
  user @ user service: at-spi-dbus-bus.service[3161],
blueman-applet.service[969792,969802], dbus.service[2947,4381,2070721],
   dirmngr.service[4002], dunst.service[3801],
filter-chain.service[3018], gvfs-udisks2-volume-monitor.service[3736],
   pipewire-pulse.service[3019], pipewire.service[2953],
wireplumber.service[3015], xdg-desktop-portal-gtk.service[3594],
   xdg-desktop-portal.service[3574]

No VM guests are running outdated hypervisor (qemu) binaries on this host.
Job for matrix-synapse.service failed because the control process exited
with error code.
See "systemctl status matrix-synapse.service" and "journalctl -xeu
matrix-synapse.service" for details.

$ journalctl -xeu matrix-synapse
Feb 20 16:59:17 nexus python3[2979902]:   File
"/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
Feb 20 16:59:17 nexus python3[2979902]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/__init__.py", line 6, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     from eventlet import convenience
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/convenience.py", line 7, in
<module>
Feb 20 16:59:17 nexus python3[2979902]:     from eventlet.green import
socket
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/green/socket.py", line 21, in
<module>
Feb 20 16:59:17 nexus python3[2979902]:     from eventlet.support import
greendns
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/support/greendns.py", line 78,
in <module>
Feb 20 16:59:17 nexus python3[2979902]:     setattr(dns, pkg,
import_patched('dns.' + pkg))
Feb 20 16:59:17 nexus python3[2979902]:
~~~~~~~~~~~~~~^^^^^^^^^^^^^^
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/support/greendns.py", line 60,
in import_patched
Feb 20 16:59:17 nexus python3[2979902]:     return
patcher.import_patched(module_name, **modules)
Feb 20 16:59:17 nexus python3[2979902]:
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/patcher.py", line 136, in
import_patched
Feb 20 16:59:17 nexus python3[2979902]:     return inject(
Feb 20 16:59:17 nexus python3[2979902]:         module_name, None,
*additional_modules + tuple(kw_additional_modules.items())
Feb 20 16:59:17 nexus python3[2979902]:     )
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/eventlet/patcher.py", line 113, in inject
Feb 20 16:59:17 nexus python3[2979902]:     module =
__import__(module_name, {}, {}, module_name.split(".")[:-1])
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/dns/asyncquery.py", line 34, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     import dns.quic
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/dns/quic/__init__.py", line 39, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     import trio
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/trio/__init__.py", line 25, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     from . import abc,
from_thread, lowlevel, socket, to_thread
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/trio/socket.py", line 16, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     from . import _socket
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/trio/_socket.py", line 546, in <module>
Feb 20 16:59:17 nexus python3[2979902]:     class SocketType:
Feb 20 16:59:17 nexus python3[2979902]:     ...<221 lines>...
Feb 20 16:59:17 nexus python3[2979902]:                 raise
NotImplementedError
Feb 20 16:59:17 nexus python3[2979902]:   File
"/usr/lib/python3/dist-packages/trio/_socket.py", line 759, in SocketType
Feb 20 16:59:17 nexus python3[2979902]:
@_wraps(_stdlib_socket.socket.sendmsg, assigned=(), updated=())
Feb 20 16:59:17 nexus python3[2979902]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 20 16:59:17 nexus python3[2979902]: AttributeError: type object
'GreenSocket' has no attribute 'sendmsg'
Feb 20 16:59:17 nexus systemd[1]: matrix-synapse.service: Control
process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ An ExecStartPre= process belonging to unit matrix-synapse.service has
exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 20 16:59:17 nexus systemd[1]: matrix-synapse.service: Failed with
result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit matrix-synapse.service has entered the 'failed' state with
result 'exit-code'.
Feb 20 16:59:17 nexus systemd[1]: Failed to start matrix-synapse.service
- Synapse Matrix homeserver.
░░ Subject: A start job for unit matrix-synapse.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit matrix-synapse.service has finished with a failure.
░░
░░ The job identifier is 230940 and the job result is failed.
Feb 20 16:59:17 nexus systemd[1]: matrix-synapse.service: Consumed
1.643s CPU time over 4.812s wall clock time, 69.8M memory peak.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit matrix-synapse.service completed and consumed the indicated
resources.
Feb 20 16:59:20 nexus systemd[1]: matrix-synapse.service: Scheduled
restart job, restart counter is at 10.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit matrix-synapse.service has been
scheduled, as the result for
░░ the configured Restart= setting for the unit.
Feb 20 16:59:20 nexus systemd[1]: Starting matrix-synapse.service -
Synapse Matrix homeserver...
░░ Subject: A start job for unit matrix-synapse.service has begun execution
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit matrix-synapse.service has begun execution.
░░
░░ The job identifier is 231070.

removing python3-eventlet makes matrix-synapse work again:

$ sudo apt-get purge python3-eventlet && sudo systemctl restart
matrix-synapse.service
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Solving dependencies... Done
The following packages were automatically installed and are no longer
required:
   linux-doc-6.16 linux-doc-6.17 linux-image-6.16.12+deb14+1-rt-amd64
linux-image-6.17.11+deb14-rt-amd64 linux-image-6.17.12+deb14-rt-amd64
   linux-image-6.17.13+deb14-rt-amd64 linux-image-6.17.8+deb14-rt-amd64
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
   python3-eventlet*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 987 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database… 1821035 files and directories currently installed.)
Removing python3-eventlet (0.40.3-2)…

$ sudo systemctl status matrix-synapse.service
● matrix-synapse.service - Synapse Matrix homeserver
      Loaded: loaded (/etc/systemd/system/matrix-synapse.service;
enabled; preset: enabled)
      Active: active (running) since Fri 2026-02-20 17:14:01 CET; 24s ago
  Invocation: b60ad88a34d04dc180f7609a665f5e0b
        Docs: file:/usr/share/doc/matrix-synapse/README.rst
     Process: 2985474 ExecStartPre=/usr/bin/python3 -m
synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml
--config-path=>
    Main PID: 2985525 (python3)
       Tasks: 12 (limit: 76824)
      Memory: 124.4M (peak: 125.5M)
         CPU: 6.230s
      CGroup: /system.slice/matrix-synapse.service
              └─2985525 /usr/bin/python3 -m synapse.app.homeserver
--config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix>

Feb 20 17:13:55 nexus systemd[1]: Starting matrix-synapse.service -
Synapse Matrix homeserver...
Feb 20 17:14:00 nexus synapse[2985525]: synapse.config.logger: [main]
***** STARTING SERVER *****
Feb 20 17:14:00 nexus synapse[2985525]: synapse.config.logger: [main]
Server /usr/lib/python3/dist-packages/synapse/app/homeserver.py version>
Feb 20 17:14:00 nexus synapse[2985525]: synapse.config.logger: [main]
Copyright (c) 2023 New Vector, Inc
Feb 20 17:14:00 nexus synapse[2985525]: synapse.config.logger: [main]
Licensed under the AGPL 3.0 license. Website: https://github.com/elemen>
Feb 20 17:14:01 nexus systemd[1]: Started matrix-synapse.service -
Synapse Matrix homeserver.

#1128500#20
Date:
2026-02-20 16:22:51 UTC
From:
To:
Hello,

Looks like something in the sentry SDK (which I think you should have mentioned you enabled).

#1128500#29
Date:
2026-02-20 16:45:49 UTC
From:
To:
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.

#1128500#34
Date:
2026-06-13 02:07:52 UTC
From:
To:
Hello,

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

#1128500#39
Date:
2026-06-19 19:31:48 UTC
From:
To:
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:

#1128500#44
Date:
2026-06-21 13:23:27 UTC
From:
To:
Control: reassign -1 python3-eventlet
Control: affects -1 matrix-synapse python3-sentry-sdk
Control: found -1 0.40.4-1

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

#1128500#55
Date:
2026-06-22 07:08:46 UTC
From:
To:
Hi,

The issue is that eventlet didn't implement:
GreenSocket.sendmsg.

Likely, recvmsg as well.

What's happening is this import stack:
eventlet → greendns → dnspython → httpcore → trio

Adding EVENTLET_NO_GREENDNS=yes as an env var avoids this.

So what's happening is Eventlet leaking a monkey-patched socket into a
dependency graph that now performs import-time API introspection.

 From my perspective, the only thing I could do would be adding a
Breaks: python3-trio in Eventlet, and call it a day. Especially because:

# python3 -c 'import eventlet'
<string>:1: EventletDeprecationWarning:
Eventlet is deprecated. It is currently being maintained in bugfix mode, and
we strongly recommend against using it for new projects.

If you are already using Eventlet, we recommend migrating to a different
framework.  For more detail see
https://eventlet.readthedocs.io/en/latest/asyncio/migration.html

FYI, the only reason Eventlet is still in Debian, is because OpenStack
hasn't finished migrating away from it.

I'll add the Breaks: and close this bug. Anyone willing to fix this bug
better must implement sendmsg / recvmsg in GreenSocket, but I'm not even
sure some new functionality will be accepted in upstream Eventlet, which
is a dying project.

Cheers,

Thomas Goirand (zigo)

#1128500#58
Date:
2026-06-22 07:11:37 UTC
From:
To:
Hello,

Bug #1128500 in python-eventlet reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/openstack-team/third-party/python-eventlet/-/commit/52fd2d72d11b28cc710783d7782f7e3ecd14b177

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1128500

#1128500#65
Date:
2026-06-22 07:34:02 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
python-eventlet, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1128500@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Thomas Goirand <zigo@debian.org> (supplier of updated python-eventlet package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Mon, 22 Jun 2026 09:09:21 +0200
Source: python-eventlet
Binary: python-eventlet-doc python3-eventlet
Architecture: source all
Version: 0.40.4-2
Distribution: unstable
Urgency: medium
Maintainer: Debian OpenStack <team+openstack@tracker.debian.org>
Changed-By: Thomas Goirand <zigo@debian.org>
Description:
 python-eventlet-doc - concurrent networking library - doc
 python3-eventlet - concurrent networking library
Closes: 1128500
Changes:
 python-eventlet (0.40.4-2) unstable; urgency=medium
 .
   * Add Breaks: python3-trio (Closes: #1128500).
Checksums-Sha1:
 53f727f5c0c2a2e0ff090648715b2f4c6fe04f77 2496 python-eventlet_0.40.4-2.dsc
 4f6afb44134b479b65ed4ee437f21a584e8d6914 23972 python-eventlet_0.40.4-2.debian.tar.xz
 7bb1f86bad57956f0bb748857fa55b216b227259 374648 python-eventlet-doc_0.40.4-2_all.deb
 702531b5fd49bb01fa24b13eed561933c6ddbf24 9467 python-eventlet_0.40.4-2_amd64.buildinfo
 72b65ec4beacaf35ef9fb8630a05ffe88cd7eedf 309372 python3-eventlet_0.40.4-2_all.deb
Checksums-Sha256:
 3ec478e1ab15b358f22a1177ba8c539118850ff664a0db31dd558cb24ba0061a 2496 python-eventlet_0.40.4-2.dsc
 bac8f7ed7e6344d4f8bb164b79184e7c00071a8ad8ec3e8229ab675132521284 23972 python-eventlet_0.40.4-2.debian.tar.xz
 980200a98eb82e9df8ad6b0d4039da349fd9385c716401ebbf6f9de296648fb1 374648 python-eventlet-doc_0.40.4-2_all.deb
 2ad48cdee17b9213aae5216415301c578ad867003da407c3ca27b6857d553000 9467 python-eventlet_0.40.4-2_amd64.buildinfo
 b167e6865c5438f0d0eb6f164140c88e992d7a6cc9d47d8e94a6971f4e060a1d 309372 python3-eventlet_0.40.4-2_all.deb
Files:
 232d30729dd8080959c480e800fd569d 2496 python optional python-eventlet_0.40.4-2.dsc
 a1a1dbaee73536e41088026d38fee175 23972 python optional python-eventlet_0.40.4-2.debian.tar.xz
 e9c895c9930be9e183c4f6177918bc2c 374648 doc optional python-eventlet-doc_0.40.4-2_all.deb
 80e05f3215d213ba80c035930c4ea98a 9467 python optional python-eventlet_0.40.4-2_amd64.buildinfo
 66f1a3e1be7b7d28ccf8723f6f96ca61 309372 python optional python3-eventlet_0.40.4-2_all.deb
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEoLGp81CJVhMOekJc1BatFaxrQ/4FAmo44OgACgkQ1BatFaxr
Q/6DlQ//SvFmF8m1mXlPUpL27Pw+aTQhuwMHCmT3Ov6YLK8pmbyqpK2+OoA33o/0
c9Lzjk2RlGqM/KrUKQL0bAIWFXEgbMYzcVYu4lOQKv5jSyre2QZqJFR03EAkGQ/D
p0oFiszOQdybHdbzyVLvFGZFBrzBUYbhjpAW2ws3UKw3ROc0SX8VRo9TyjU0Gln1
MM9frrgEQHipY5Gfw9aSJ8+dIkqsdjm/JGy3kI8nYm7Vix902TDlf7nz6cxnf2YV
89Q+CSaituQPjlGPMil0PAvSxWmQQwz4yeauvlH44PX7Gsi5iyPSaWLZlyGCddte
lckssqY0DK7OEW3yy2jq7UNOAY7GtcEpq4suG+IIOWr7LRMR1JHwp9i5PcMeGeqj
0xDDi99X3BTzKAsjaUNeloaNfaS90yl12ZcM230iz2O+Y3y2l5PBDK6evUwYoRzn
3RVqs+mV4g1m5jPOWM7naRtwkSf1nH8mYVQBY9oFExonFFRq2K2MvoVD1HXKKXhC
6fBm+VD7u5bbdQ9Cqz+SdajiwkCmjbvzAxvgjyPuom1s0DiHmczwz+6JPM3CeSRN
L1WKN0EHHRycadD+Jj7jLbPFbi5LrXsh8fljvbR6BDMJ8AxN45NAlKHjGVHL0FKU
53hCaSCokmf/3SYeSTwyUop/bM9xVONeOWFygaLwSHo1U3hOsMs=
=fwQB
-----END PGP SIGNATURE-----