element-hq / element-hq/synapse

Docs: Federation troubleshooting re: Cloudflare

Open
#16,228 0 comments 1 reaction 0 assignees View on GitHub
A-Docs A-Federation T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#16228](https://github.com/matrix-org/synapse/issues/16228).

---

**Description:**

I am using Cloudflare as my DNS provider. When attempting to federate (using port 8448), I was getting errors like

```
Get "https://104.21.90.241:8448/_matrix/key/v2/server": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

"https://[2606:4700:3036::ac43:a2cf]:8448/_matrix/key/v2/server": dial tcp [2606:4700:3036::ac43:a2cf]:8448: i/o timeout (Client.Timeout exceeded while awaiting headers)
```

I determined this to be caused by the fact that, [when using Cloudflare's proxying only certain ports are allowed](https://developers.cloudflare.com/fundamentals/reference/network-ports/). The simple solution is to turn off proxying (set matrix DNS entry to "DNS-only").

---

To elaborate, what happens (in my case) is:

- `https://example.com/.well-known/_matrix/server` is fetched, it delegates to `https://matrix.example.com`
- `https://matrix.example.com` resolves to a Cloudflare proxy IP address
- Attempt to reach `https://:8448`
- Cloudflare unhappy :(

You could presumably also change your configuration to use one of the supported ports.

---

I think a note in the delegation and/or federation docs about usage with Cloudflare would go a long way here to save some headache.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.