element-hq / element-hq/synapse
Room invite API call returns error code M_UNKNOWN
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9804](https://github.com/matrix-org/synapse/issues/9804).
---
### Description
Whilst debugging vector-im/element-web#16924 I found myself having to create a lot of room to reproduce the race condition described there.
Looking throught the looks I could sporadically see the room invite API endpoint returning a 500
```
{
"errcode": "M_UNKNOWN",
"error": "Internal server error"
}
```
### Steps to reproduce
- Create many rooms quickly and invite a user from mozilla.org
@anoadragon453 kindly agreed to look at the logs and reported
> you tried to invite someone from mozilla.org, which returned a 429 ratelimiting error over federation, and matrix.org's federation client didn't know how to handle 429 errors and has returned a 500 to you as a result.
> So it looks like we'll retry a certain number of times and then just raise as a 500. Which probably isn't really the best way to handle a 429 response. I'm slightly surprised that we even hit a ratelimit if we do back off though.
### Version information
- **Homeserver**: matrix.org
Contributor guide
Assessment
This issue has not been assessed yet.