Synapse: unbans do not propagate to federated servers (SYN-725)

Created on 13 Jul 2016  路  5Comments  路  Source: matrix-org/synapse

Submitted by @​richvdh:sw1v.org

  1. ban user on remote server
  2. re-invite user on remote server
  3. user receives invite but their HS still thinks they are banned

(Imported from https://matrix.org/jira/browse/SYN-725)

bug

All 5 comments

Ideas for workarounds (currently untested):

method 1

  • Create second user on homeserver.
  • Join room using that user. That should pull the latest room state
  • You should then be able to join with the original user.
  • If desired, leave the room from the second user, and deactivate the second user account.

method 2

Alternatively, if you are sure that this is the only user in the room on the affected homeserver, you can try some surgery on your database. Take a backup first, in case of mistakes.

  • Run this query on your homeserver database (substitute !room_id:domain appropriately)
select * from event_forward_extremities where room_id='<!room_id:domain>';
  • We expect to see one result. Keep note of it, in case this blows up. If there is more than one, or zero, you have other problems.
  • Shut down synapse
  • Run the following query. Make sure the 'where' part exactly matches what you had in the 'select' query above:
delete from event_forward_extremities where room_id='<!room_id:domain>';
  • Restart synapse
  • Try joining the room again.

Please let me know if you have any success with either of these methods

Thanks to richvdh for getting back to me on that issue via Twitter/Matrix.

I tried Method 1 with my federated homeserver and it worked fine.
Joining the room with the temporary account synched the room and allowed the accidentally banned, then unbanned account to join again immediately.

My homeserver was running synapse 0.20.0 on FreeBSD 11 at that time.
Interestingly when the unban message is missing on a homeserver and the user gets an invitation to join the room in the meantime, you end up with Schroedingers invitation. You cannot accept the invitation, you cannot decline the invitation and you can't get rid of the invitation.

I haven't tried method 2.

neil: really? we want this for v1.0? it's not easy :/

I tried both method 1 and method 2, to no avail. My attempts sometimes still show me as banned, sometimes tell me I can't preview the room, sometimes allow me to preview, but joining just keeps spinning forever to no avail.

Other people see me as having joined (multiple times), but the spinning wheel never stops, the room never gets added to my list, and I can never speak. I've tried multiple flavors of Riot.

More context can be found in this issue

The event that gets received in the rooms looks like:

{
  "content": {
    "avatar_url": "mxc://mutnt.io/xtfOWjOPxlUDntuZcsbpnRbc",
    "displayname": "Xananax",
    "membership": "join"
  },
  "event_id": "$15698602680XKphH:mutnt.io",
  "origin_server_ts": 1569860268236,
  "sender": "@xananax:mutnt.io",
  "state_key": "@xananax:mutnt.io",
  "type": "m.room.member",
  "unsigned": {
    "age": 108,
    "replaces_state": "$1569573974171540mjBIK:matrix.org",
    "prev_content": {
      "membership": "ban"
    },
    "prev_sender": "@abuse:matrix.org"
  },
  "room_id": "!QtykxKocfZaZOUrTwp:matrix.org"
}

image

FYI this is still a problem.

Was this page helpful?
0 / 5 - 0 ratings