element-hq / element-hq/dendrite

Unable to join public rooms

Open
#3,248 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
965
Forks
101
PR merge metrics
No merged PRs in 30d

Description

*This issue was originally created by [**@blind-oracle**](https://github.com/blind-oracle) at .*

### Background information

- **Dendrite version or git SHA**: #3244
- **SQLite3 or Postgres?**: PG
- **Running in Docker?**: No
- **`go version`**: 1.21.3
- **Client used (if applicable)**: Element

dendrite is running behind nginx that does TLS termination and reverse proxy.

```
location /.well-known/matrix/server {
return 200 '{ "m.server": "novg.net:443" }';
}

location /.well-known/matrix/client {
return 200 '{ "m.homeserver": { "base_url": "https://novg.net" } }';
}

location /_matrix {
proxy_pass http://127.0.0.1:8088;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 600;
}
```

### Description

- **What** is the problem: Unable to join any public rooms outside my host
- **Who** is affected:
- **How** is this bug manifesting:
- **When** did this first appear:

### Steps to reproduce

- Setup dendrite
- Register account
- Try to join some matrix.org or libera.chat rooms
- Observe infinite `Joining...` spinner

The errors 524/520 look like a Cloudflare timeouts or similar, but doing `curl` works fine to the given URLs.

In the logs:
```
Oct 28 18:19:27 novg dendrite[3205549]: time="2023-10-28T16:19:27.855043139Z" level=warning msg="Failed to join room through server" error="r.federation.SendJoin: contents=[] msg=Failed to PUT JSON (hostname \"matrix.org\" path \"/_matrix/federation/v2/send_join/!OGEhHVWSdvArJzumhm:matrix.org/$HohCRwjjZWmrs54SNMven2HXOr-0u2_WdKF0zl4zfJQ\"): code=524 wrapped=" room_id="!OGEhHVWSdvArJzumhm:matrix.org" server_name=matrix.org
Oct 28 18:19:28 novg dendrite[3205549]: time="2023-10-28T16:19:27.855146010Z" level=error msg="failed to join user \"@blind_oracle:novg.net\" to room \"!OGEhHVWSdvArJzumhm:matrix.org\" through 2 server(s): last error r.federation.SendJoin: contents=[] msg=Failed to PUT JSON (hostname \"matrix.org\" path \"/_matrix/federation/v2/send_join/!OGEhHVWSdvArJzumhm:matrix.org/$HohCRwjjZWmrs54SNMven2HXOr-0u2_WdKF0zl4zfJQ\"): code=524 wrapped="
Oct 28 18:19:28 novg dendrite[3205549]: time="2023-10-28T16:19:27.855207419Z" level=error msg="Failed to join room" error="contents=[] msg= code=524 wrapped=" room_id="#matrix:matrix.org" servers="[libera.chat]" user_id="@blind_oracle:novg.net"
```

Contributor guide

Open the contributing guide

Research direction

Start with the federation SendJoin path shown in the logs and compare it with the nginx reverse-proxy configuration and timeout responses. Reproduce a join to the listed public rooms, trace the 520/524 failure, and consider the issue done when external room joins complete without the infinite spinner or federation timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, nginx, postgres
Domain
backend, distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.