element-hq / element-hq/synapse
Less than intermittent federation connection failures
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
### Description
For maybe a month now, it seems that some Synapse deployments have had trouble federating with my homeserver. Until now this was primarily just remote servers, like matrix.org, but now I'm noticing my own local servers are seemingly unable to federate with me reliably.
This is most noticeable when trying to accept an invite from my homeserver - Synapse sits on the join request for a while before eventually telling the client it was unable to `make_join` via any server. This is odd since it received the invite just fine.
Upon inspecting the logs of one of my deployments, I saw this:
```
2026-01-19 17:32:15,379 INFO synapse.http.federation.well_known_resolver (POST-243204): Fetching https://nexy7574.co.uk/.well-known/matrix/server
2026-01-19 17:32:35,380 INFO synapse.http.federation.well_known_resolver (POST-243204): Error fetching https://nexy7574.co.uk/.well-known/matrix/server: HostnameAddress(hostname=b'ipv4.games', port=443)
2026-01-19 17:32:35,381 INFO synapse.http.matrixfederationclient (POST-243204): {GET-O-18199} [nexy7574.co.uk] Request failed: GET matrix-federation://nexy7574.co.uk/_matrix/federation/v1/make_join/%2169XhrqEoZvKsWXWAeM%3Anexy7574.co.uk/%40nex%3Astarstruck.systems?ver=1&ver=2&ver=3&ver=4&ver=5&ver=6&ver=7&ver=8&ver=9&ver=10&ver=11&ver=12&ver=org.matrix.msc3757.10&ver=org.matrix.msc3757.11&ver=org.matrix.hydra.11: TimeoutError('Timed out after 20s')
2026-01-19 17:32:35,381 INFO synapse.util.retryutils (POST-243204): Connection to nexy7574.co.uk was unsuccessful ((Failed to send request: TimeoutError: Timed out after 20s)); backoff now 10000
2026-01-19 17:32:35,381 WARNING synapse.federation.federation_client (POST-243204): Failed to make_join via nexy7574.co.uk: Failed to send request: TimeoutError: Timed out after 20s
2026-01-19 17:32:35,416 WARNING synapse.logging.context (POST-243204): Re-starting finished log context POST-243204
2026-01-19 17:32:35,515 WARNING synapse.logging.context (POST-243204): Re-starting finished log context POST-243204
2026-01-19 17:32:35,521 INFO synapse.http.matrixfederationclient (POST-243204): {GET-O-18206} [nexy7574.co.uk] Completed request: 200 OK in 0.14 secs, got 960 bytes - GET matrix-federation://nexy7574.co.uk/_matrix/federation/v1/make_join/%2169XhrqEoZvKsWXWAeM%3Anexy7574.co.uk/%40nex%3Astarstruck.systems?ver=1&ver=2&ver=3&ver=4&ver=5&ver=6&ver=7&ver=8&ver=9&ver=10&ver=11&ver=12&ver=org.matrix.msc3757.10&ver=org.matrix.msc3757.11&ver=org.matrix.hydra.11
2026-01-19 17:32:35,524 INFO synapse.federation.federation_client (POST-243204): send_join: Not retrying server nexy7574.co.uk because we tried it recently retry_last_ts=1768843955381 and we won't check for another retry_interval=10000ms.
2026-01-19 17:32:35,524 INFO synapse.federation.federation_client (POST-243204): send_join: Not retrying server nexy7574.co.uk because we tried it recently retry_last_ts=1768843955381 and we won't check for another retry_interval=10000ms.
2026-01-19 17:32:35,525 INFO synapse.http.server (POST-243204): SynapseError: 502 - Failed to send_join via any server
2026-01-19 17:32:35,526 INFO synapse.access.http.8008 (POST-243204): 80.3.155.46 - 8008 - {@nex:starstruck.systems} Processed request: 20.154sec/0.000sec (0.006sec, 0.001sec) (0.001sec/0.007sec/13) 83B 502 "POST /_matrix/client/v3/join/%2169XhrqEoZvKsWXWAeM:nexy7574.co.uk?via=nexy7574.co.uk HTTP/1.1" "gomuks/v26.01+dev.a097ca9a mautrix-go/v0.26.2+dev.28bcc356 go/1.25.6" [0 dbevts]
```
It looks like the request to make_join is timing out, but you can also see it successfully returning a 200 OK in under 0.2 seconds. My reverse proxy logs confirm this too.
Room joins are only the most noticeable though - I've also noticed that it seems that federated transactions can backlog too, resulting in spotty federation, which is quite disruptive when a lot of my communications on my Synapse deployments are small encrypted rooms. Sending an event from my main server to reset the backoff sometimes does actually work and allows me to federate with my Synapses again for a short while, but it's not something that lasts very long.
### Steps to reproduce
I am unsure what the issue here is so can't really provide reproduction steps. As far as I can tell the requests are being served and somehow Synapse is internally waiting too long?
My setup is fairly standard, both Synapses and the main server are all on the same proxmox node (individual LXCs), but federation roundtrips to my external ingress node before being reverse proxied back.
### Homeserver
matrix.org, synapse.nexy7574.co.uk, starstruck.systems
### Synapse Version
1.145.0
### Installation Method
pip (from PyPI)
### Database
mono clean postgres
### Workers
Single process
### Platform
starstruck is an ubuntu LXC, synapse.n7574 is a docker container in an ubuntu LXC, nexy7574.co.uk is an ubuntu LXC, all inbound federation goes through external ingress
### Configuration
starstruck.systems has synapse-http-antispam, synapse.nexy7574 does not
### Relevant log output
```shell
provided above for context
```
### Anything else that would be useful to know?
This seems to be a recent issue. I can't pinpoint a specific version, but it seemingly started in one of the recent 1.14X versions.
Contributor guide
Assessment
This issue has not been assessed yet.