-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twisted has a new version which causes failure #17882
Comments
As you can see _encodeName was part of the private API. It is removed in the 24.10.0 I think the intent is to use the |
Can confirm the issue. I downgraded Twisted and Synapse works again. |
Running into this issue as well, prevents synapse from starting. (Synapse 1.118.0) |
Can confirm downgrading to the last version of Twisted remedies the issue |
Same issue on my side, downgrade also fixed the issue. |
It is currently also related to #17075. |
Twisted just got updated on my system and it broke my server. I cannot downgrade Twisted easily as it's coming from the system and not pip. Please fix this urgently (some people will not be able to bring their Matrix server back online until you do a new release with this!) and never use private functions in the future! They're private for a reason (because using them results in breaking). |
Ok, this is kinda ridiculous: This method didn't do anything complex, there really was no justification for ever using this private method. Workaround: Replace this code: if hasattr(Headers, "_canonicalNameCaps"):
# Twisted < 24.7.0rc1
_canonicalHeaderName = Headers()._canonicalNameCaps # type: ignore[attr-defined]
else:
# Twisted >= 24.7.0rc1
# But note that `_encodeName` still exists on prior versions,
# it just encodes differently
_canonicalHeaderName = Headers()._encodeName With this: def _canonicalHeaderName(name):
if isinstance(name, unicode):
return name.lower().encode('iso-8859-1')
return name.lower() My Synapse is back up with this. |
What's holding this back? There seems to be a solution (@Midar could you turn this into a PR?) and pinning Twisted to an outdated and potentially insecure version should clearly be fixed ASAP. Thanks! |
Description
I just started getting this error.
This is due to an update to Twisted from v24.7.0 to v24.10.0 .
Forcing the older version
pip install --force-reinstall -v "Twisted==24.7.0"
and that corrected the error.Apparently,
_canonicalHeaderName = Headers()._encodeName
is no longer valid.Steps to reproduce
Homeserver
generating a new homeserver.yaml
Synapse Version
1.117.0
Installation Method
pip (from PyPI)
Database
sqlite
Workers
Single process
Platform
Ubuntu 24
fedora 40
Configuration
No response
Relevant log output
Anything else that would be useful to know?
I updated the
synapse/http/proxy.py
about line 74 to gain some insight.While this is not a fix, it may be useful.
The text was updated successfully, but these errors were encountered: