element-hq / element-hq/synapse
LIMIT_EXCEEDED (429) error when inviting user to a room on a (deep) hierarchical space structure.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#15882](https://github.com/matrix-org/synapse/issues/15882).
---
### Description
When creating a space hierarchy of several levels and then inviting a user into a room in the deep hierarchy a LIMIT_EXCEEDED / Too many requests (429) arises. This is on single room / single invite not in multi invite on multiple rooms.
### Steps to reproduce
1. Create two users,
1. Then create a space hierarchy with first user down to 5 levels.
1. Then create a room into the 5th level of spaces.
1. Then try invite 2nd user into the room.
1. You will most likely get 429 error.
Using standard `rc_limits` i.e. fresh Synapse setup.
### Homeserver
Another home server running on UpCloud VM
### Synapse Version
v1.87
### Installation Method
Debian packages from packages.matrix.org
### Database
PostgreSQL
### Workers
Single process
### Platform
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Server running on VM in UpCloud
### Configuration
Fresh Synapse install, standard setups
### Relevant log output
```shell
Homeserver.log
2023-07-05 07:30:41,571 - synapse.http.server - 117 - INFO - POST-1016 - SynapseError: 429 - Too Many Requests
2023-07-05 07:30:41,572 - synapse.access.http.8008 - 482 - INFO - POST-1016 - 94.31.96.232
```
### Anything else that would be useful to know?
-
Contributor guide
Research direction
Reproduce the five-level space hierarchy and invite through the /_matrix/client/r0/rooms/{room_id}/invite endpoint, using the provided homeserver log as the starting evidence. Trace why a single invite reaches the standard rate limit and verify that the invite succeeds without a 429 under the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100