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

Accepting an invite to a room on another HS returns a 404 #2807

Open
ewingrj opened this issue Jan 18, 2018 · 12 comments
Open

Accepting an invite to a room on another HS returns a 404 #2807

ewingrj opened this issue Jan 18, 2018 · 12 comments
Labels
A-Application-Service Related to AS support A-Federation A-Invite Inviting users to rooms and accepting invites O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@ewingrj
Copy link

ewingrj commented Jan 18, 2018

Description

In the matrix-appservice-slackbot, the bot will auto join any rooms it has been invited to. If a user from another HS invites the bot to a room that hasn't been synced to the bots HS, synapse will throw an error 2018-01-18 01:26: [-] POST https://matrix.giveth.io/_matrix/client/r0/join/!TAeakIVVBKXyGipXoY%3Amatrix.org AS) HTTP 404 Error: {"errcode":"M_UNKNOWN","error":"No row found"}.

Version information

  • Homeserver: Was this issue identified on matrix.org or another homeserver?

If not matrix.org: giveth.io

  • Version: 26
  • Install method: package manager
  • Platform: VPS w/ debian 9
@richvdh
Copy link
Member

richvdh commented Jan 24, 2018

is this specific to the matrix-appservice-slackbot?

Are you sure the bot has a pending invitation to the room? This sounds like synapse failing to find a remote server to help with the join request, but it should check if there is pending invitation and use that: https://github.com/matrix-org/synapse/blob/master/synapse/handlers/room_member.py#L287

We'll probably need to see the logs to diagnose further

@ewingrj
Copy link
Author

ewingrj commented Jan 25, 2018

I haven't testing if this is specific to the matrix-appservice-slack bridge or not.

yes, I'm sure about the pending invitation.

here's the invite msg:

{
  "origin_server_ts": 1516886875874,
  "sender": "@perissology:matrix.org",
  "event_id": "$15168868758429051VcQex:matrix.org",
  "unsigned": {
    "age": 772
  },
  "state_key": "@slackbot:giveth.io",
  "content": {
    "membership": "invite"
  },
  "membership": "invite",
  "type": "m.room.member",
  "room_id": "!MPjsKDPOIfQrVFcgUU:matrix.org"
}

and the logs from the giveth.io server from right before the invite to after the failure:
https://gist.github.com/perissology/e18b126b7e1348210ae7e154e0cb81d5

@ara4n
Copy link
Member

ara4n commented Feb 6, 2018

This feels like a general bug with federation interacting with application services - although I'm surprised @turt2live hasn't encountered it... @turt2live, any idea what might be going on here?

@ara4n ara4n added z-bug (Deprecated Label) z-p2 (Deprecated Label) z-major (Deprecated Label) labels Feb 6, 2018
@ara4n
Copy link
Member

ara4n commented Feb 6, 2018

@perissology thanks for the excellent bug report & details btw

@turt2live
Copy link
Member

@ara4n I actually added a retry loop to almost everything I've deployed to combat this. The common failure is the room comes down the /sync stream, but the homeserver isn't aware of the room yet. It can sometimes take minutes for the room the appear.

@turt2live
Copy link
Member

Well, this is fun. I just ran into this on my test server. The logs are very unexciting:

2018-02-21 19:07:55,983 - synapse.access.http.8008 - 59 - INFO - POST-247- 172.16.0.1 - 8008 - Received request: POST /_matrix/client/r0/join/!nrZKEcuLPAvzNPfAsH%3At2l.io?access_token=<redacted>
2018-02-21 19:07:55,984 - synapse.util.async - 230 - INFO - POST-247- Acquired uncontended linearizer lock 'member' for key (u'!nrZKEcuLPAvzNPfAsH:t2l.io',)
2018-02-21 19:07:55,984 - synapse.util.async - 230 - INFO - POST-247- Acquired uncontended linearizer lock 'state_resolve_lock' for key frozenset([])
2018-02-21 19:07:55,985 - synapse.state - 455 - INFO - POST-247- Resolving state for !nrZKEcuLPAvzNPfAsH:t2l.io with 0 groups
2018-02-21 19:07:55,985 - synapse.util.async - 237 - INFO - POST-247- Releasing linearizer lock 'state_resolve_lock' for key frozenset([])
2018-02-21 19:07:55,988 - synapse.util.async - 237 - INFO - POST-247- Releasing linearizer lock 'member' for key (u'!nrZKEcuLPAvzNPfAsH:t2l.io',)
2018-02-21 19:07:55,989 - synapse.http.server - 162 - INFO - POST-247- <XForwardedForRequest at 0x7fdb665ea200 method=POST uri=/_matrix/client/r0/join/!nrZKEcuLPAvzNPfAsH%3At2l.io?access_token=<redacted> clientproto=HTTP/1.0 site=8008> SynapseError: 404 - No row found
2018-02-21 19:07:55,989 - synapse.access.http.8008 - 93 - INFO - POST-247- 172.16.0.1 - 8008 - {@_discord_bot:dev.t2bot.io} Processed request: 5ms (0ms, 0ms) (0ms/1ms/1) 46B 404 "POST /_matrix/client/r0/join/!nrZKEcuLPAvzNPfAsH%3At2l.io?access_token=<redacted> HTTP/1.0" "None"

@danilaplee
Copy link

danilaplee commented May 10, 2018

this is the bug, i was talking about a month ago, it's really wide, i have a server completely locked out of federation due to this issue

2018-05-10 13:52:50,153 - synapse.util.async - 296 - INFO - PUT-5442287- Releasing limiter lock for key u'!KjedgbiACDMhyAYZzU:matrix-01<redacted>'
2018-05-10 13:52:50,155 - synapse.util.async - 230 - INFO - PUT-5442287- Acquired uncontended linearizer lock 'rules_for_room' for key ()
2018-05-10 13:52:50,156 - synapse.util.async - 237 - INFO - PUT-5442212- Releasing linearizer lock 'member' for key (u'!GCmQbvPeGOnqXNnSsL:matrix-01<redacted>',)
2018-05-10 13:52:50,156 - synapse.handlers.profile - 250 - WARNING - PUT-5442212- Failed to update join event for room !GCmQbvPeGOnqXNnSsL:matrix-01<redacted> - 4484590
2018-05-10 13:52:50,156 - synapse.util.async - 230 - INFO - PUT-5442212- Acquired uncontended linearizer lock 'member' for key (u'!WsJLlVBOlInCGskuzt:matrix-10<redacted>',)
2018-05-10 13:52:50,157 - twisted - 131 - CRITICAL - - Unhandled error in Deferred:
2018-05-10 13:52:50,157 - twisted - 131 - CRITICAL - - KeyError: 4484590

@richvdh richvdh changed the title Accepting an invite to a room on another HS, throws an error Accepting an invite to a room on another HS returns a 404 Jan 3, 2019
@theotheroracle
Copy link

i'm pretty sure i'm experiencing this issue, if i make a chat on the librem.one HS and invite someone from matrix, it gives the M_UNKOWN error.

@richvdh
Copy link
Member

richvdh commented Dec 11, 2019

@theotheroracle
Copy link

would that be in the browser console? or where would i find the synapse

@MadLittleMods MadLittleMods added A-Federation A-Invite Inviting users to rooms and accepting invites A-Application-Service Related to AS support T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels May 16, 2022
@squahtx
Copy link
Contributor

squahtx commented Oct 5, 2022

Is this still happening on recent releases of Synapse?

@turt2live
Copy link
Member

Yes. Constantly.

@squahtx squahtx removed z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Oct 5, 2022
@squahtx squahtx added S-Minor Blocks non-critical functionality, workarounds exist. O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience and removed z-major (Deprecated Label) labels Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Application-Service Related to AS support A-Federation A-Invite Inviting users to rooms and accepting invites O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

8 participants