Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Auto-join rooms rate limited #8866

Closed
cnvandijk opened this issue Dec 2, 2020 · 1 comment · Fixed by #8921
Closed

Auto-join rooms rate limited #8866

cnvandijk opened this issue Dec 2, 2020 · 1 comment · Fixed by #8921
Assignees
Labels
z-bug (Deprecated Label)

Comments

@cnvandijk
Copy link

Description

Adding a new user to rooms defined in auto_join_rooms is incorrectly rate-limited.

Steps to reproduce

  • configure homeserver.yaml with N>3 rooms listed in auto_join_rooms
  • register a new user
  • user is joined to first three rooms correctly, however all subsequent joins are incorrectly rate-limited:
synapse.handlers.register - 453 - ERROR - POST-119262 - Failed to join new user to '#<alias>:<domain>': LimitExceededError('429: Too Many Requests')

Version information

  • Version:
{
    "python_version": "3.8.6",
    "server_version": "1.23.0"
}
  • Install method: Docker matrixdotorg/synapse:v1.23.0
  • Platform: Host is Ubuntu 20.04.1 LTS

Additional info

For this particular user, also setting their display name from our LDAP failed:

rest_auth_provider - 76 - INFO - POST-119262 - Registration based on REST data was successful for @<user>:<domain>
rest_auth_provider - 81 - INFO - POST-119262 - Handling profile data
rest_auth_provider - 92 - INFO - POST-119262 - Setting display name to '<displayname>' based on profile data
rest_auth_provider - 99 - INFO - POST-119262 - Handling 3PIDs
rest_auth_provider - 106 - INFO - POST-119262 - Looking for 3PID email:<user>@<domain> in user profile
twisted - 254 - WARNING - POST-119262 - /usr/local/lib/python3.8/site-packages/twisted/internet/defer.py:1418: builtins.RuntimeWarning: coroutine 'ProfileWorkerStore.set_profile_displayname' was never awaited
rest_auth_provider - 119 - INFO - POST-119262 - 3PID is present, skipping
twisted - 254 - WARNING -  - /usr/local/lib/python3.8/site-packages/twisted/internet/defer.py:1475: builtins.RuntimeWarning: coroutine 'RegistrationWorkerStore.get_user_id_by_threepid' was never awaited

I assume this is the same issue as the above messages occur less than one second after Failed to join new user, but otherwise let me know if you would like me to open a separate report.

Related issues

I can see a few issues opened recently that seem similar: #8735, #8791 and #8736.

@anoadragon453
Copy link
Member

Ah, this would be another case of the rate limit on joins not being overridden in the correct place. However, I notice that that particular codepath already has ratelimit set to False, so it looks like there's a bug somewhere:

await room_member_handler.update_membership(
requester=create_requester(
user_id, authenticated_entity=self._server_name
),
target=UserID.from_string(user_id),
room_id=room_id,
remote_room_hosts=remote_room_hosts,
action="join",
ratelimit=False,
)

For the display name issue, it looks like you're using https://github.com/ma1uta/matrix-synapse-rest-password-provider? I'm aware of that library needing some updates, although keep in mind that is a community repo. It looks like your particular issue is tracked at ma1uta/matrix-synapse-rest-password-provider#6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants