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

Attempting to resync the device list for non existing user after federation turned off. #10218

Open
brunakov opened this issue Jun 19, 2021 · 3 comments
Labels
S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@brunakov
Copy link

brunakov commented Jun 19, 2021

Description

After disabling federation for my homeserver, I get logs related to device lists resync, for users that are no more in any rooms.
Using nginx as reverse proxy, I have disabled federation by removing 8448 port from nginx conf file, set federation_domain_whitelist =[], and denied 8448 in ufw firewall.
A log entry example would be:

2021-06-18 12:26:27,235 - synapse.handlers.device - 844 - DEBUG - _maybe_retry_device_resync-106 - Attempting to resync the device list for @philipp:netzgemeinde.eu
2021-06-18 12:26:27,235 - synapse.federation.federation_client - 175 - DEBUG - _maybe_retry_device_resync-106 - Invoked 'query_user_devices' with args: self=<synapse.federation.federation_client.FederationCl..., destination=netzgemeinde.eu, user_id=@philipp:netzgemeinde.eu, timeout=30000
2021-06-18 12:26:27,235 - synapse.federation.transport.client - 476 - DEBUG - _maybe_retry_device_resync-106 - Invoked 'query_user_devices' with args: self=<synapse.federation.transport.client.TransportLaye..., destination=netzgemeinde.eu, user_id=@philipp:netzgemeinde.eu, timeout=30000
2021-06-18 12:26:27,236 - synapse.handlers.device - 879 - INFO - _maybe_retry_device_resync-106 - 403: Federation denied with netzgemeinde.eu.

Looking at the database I find entries for this user in :

  • cache_invalidation_stream_by_instance
  • current_state_delta_stream
  • device_lists_remote_cache
  • device_lists_remote_resync
  • device_lists_stream
  • presence_stream

What tables have to be cleared for this user, so that synapse stops to resync the device list for those users ?
Any APIs I can safely use?

Version information

  • Version: 1.36

  • Install method:
    apt package manager

  • Platform:
    Ubuntu Server 20.04

@brunakov
Copy link
Author

brunakov commented Jun 19, 2021

I found a single entry for each user synapse wants to resync their devices list, in device_lists_remote_resync table. Maybe I could delete the entries from there ?

@erikjohnston
Copy link
Member

I found a single entry for each user synapse wants to resync their devices list, in device_lists_remote_resync table. Maybe I could delete the entries from there ?

Yup, that should work.

We should make sure that that happens automatically when we no longer share a room with the user. I think its just a case of adding a delete clause to mark_remote_user_device_list_as_unsubscribed function.

@erikjohnston erikjohnston added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Jun 21, 2021
@brunakov
Copy link
Author

By the way I deleted all entries on device_lists_remote_resync and the problem did not re-occur.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

2 participants