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

Error: not invited when joining too quickly #2367

Open
silkeh opened this issue Jul 13, 2017 · 3 comments
Open

Error: not invited when joining too quickly #2367

silkeh opened this issue Jul 13, 2017 · 3 comments
Labels
A-Federated-Join joins over federation generally suck T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@silkeh
Copy link
Contributor

silkeh commented Jul 13, 2017

On the Matrix-IRCnet bridge some people have trouble sending a message to a person.
The cause seems to be that if the invited party joins too quickly, the inviting homeserver denies the join.
The bridge automatically joins, resulting in 307 ms between sending the invite and receiving the join.

The resulting response is SynapseError: 403 - You are not invited to this room.
log.txt contains the debug log for the two requests (creating/inviting and joining).

On the server, I see the following events:

| event_id                 | type                      | content
---------------------------+---------------------------+---------
 $14999418670pJBSM:slxh.eu | m.room.create             | {"creator":"@silex:slxh.eu"}
 $14999418681RDRYI:slxh.eu | m.room.member             | {"avatar_url":"mxc://slxh.eu/firYUbGCedTKEeYmayUSnKUz","displayname":"Silke","membership":"join"}
 $14999418682SbYPV:slxh.eu | m.room.power_levels       | {"ban":50,"events":{"m.room.avatar":50,"m.room.canonical_alias":50,"m.room.history_visibility":100,"m.room.name":50,"m.room.power_levels":100},"events_default":0,"invite":0,"kick":50,"redact":50,"state_default":50,"users":{"@_ircnet_^^_^^:irc.snt.utwente.nl":100,"@silex:slxh.eu":100},"users_default":0}
 $14999418693oWJMx:slxh.eu | m.room.join_rules         | {"join_rule":"invite"}
 $14999418704rTiYM:slxh.eu | m.room.history_visibility | {"history_visibility":"shared"}
 $14999418715zKlyB:slxh.eu | m.room.guest_access       | {"guest_access":"can_join"}
 $14999418736ROTWn:slxh.eu | m.room.member             | {"avatar_url":null,"displayname":"^^_^^ (IRC)","is_direct":true,"membership":"invite"}

The server then creates (and signs) the following event.
Note that the prev_events is actually one event too early.

{
	"auth_events": [
		["$14999418670pJBSM:slxh.eu", {
			"sha256": "h4wQhafYBJ0hw0pByePewTZ/Wisd1mlYYy7b3+jYjkw"
		}],
		["$14999418682SbYPV:slxh.eu", {
			"sha256": "lMBl4s8tP82N2cRY3AvmMeOpO4T8U0/YClTiQazi0V8"
		}],
		["$14999418693oWJMx:slxh.eu", {
			"sha256": "aEkbGx/4vEZ6dPdm/+5PdLSEhnq7U0uDqyUIWyihYxU"
		}]
	],
	"content": {
		"membership": "join"
	},
	"depth": 7,
	"event_id": "$14999418747tuojQ:slxh.eu",
	"hashes": {
		"sha256": "ZiMyi5EnmrKtVdUm0WpPmL6kD9EWLGhrDyKcDMcYZEU"
	},
	"origin": "slxh.eu",
	"origin_server_ts": 1499941874430,
	"prev_events": [
		["$14999418715zKlyB:slxh.eu", {
			"sha256": "VJCVgu/nkJJQ3/KAstVu/xbVyD8F+ve7iY4faRsje+U"
		}]
	],
	"prev_state": [],
	"room_id": "!pJHIzJXCnKbrJoTqKR:slxh.eu",
	"sender": "@_ircnet_^^_^^:irc.snt.utwente.nl",
	"signatures": {},
	"state_key": "@_ircnet_^^_^^:irc.snt.utwente.nl",
	"type": "m.room.member"
}
@MurzNN
Copy link

MurzNN commented Jul 3, 2019

Seems I got same problem when inviting bots from other homeserver, here are logs:

2019-07-03 15:38:11,238 - synapse.http.matrixfederationclient - 401 - INFO - POST-3642- {PUT-O-367} [homeserver2.com] Sending request: PUT matrix://homeserver2.com/_matrix/federation/v2/invite/%21SgBFimbGVUVNLDYaJc%3Ahomeserver1.com/%24j0G6ruROEadC-1pCTN8eCkdZQAzYT9qlWsRI22k4Pt8; timeout 60.000000s
2019-07-03 15:38:11,609 - synapse.access.http.8008 - 233 - INFO - GET-3648- 82.162.163.148 - 8008 - Received request: GET /_matrix/federation/v1/make_join/%21SgBFimbGVUVNLDYaJc%3Ahomeserver2.com/%40voice2text%3Ahomeserver2.com?ver=1&ver=state-v2-test&ver=4&ver=3&ver=2
2019-07-03 15:38:11,705 - synapse.http.server - 85 - INFO - GET-3648- <XForwardedForRequest at 0x7f326e81bda0 method='GET' uri='/_matrix/federation/v1/make_join/%21SgBFimbGVUVNLDYaJc%3Ahomeserver1.com/%40voice2text%3Ahomeserver2.com?ver=1&ver=state-v2-test&ver=4&ver=3&ver=2' clientproto='HTTP/1.0' site=8008> SynapseError: 403 - You are not invited to this room.
2019-07-03 15:38:11,732 - synapse.access.http.8008 - 302 - INFO - GET-3648- 82.162.163.148 - 8008 - {homeserver2.com} Processed request: 0.123sec/0.000sec (0.008sec, 0.002sec) (0.009sec/0.019sec/3) 69B 403 "GET /_matrix/federation/v1/make_join/%21SgBFimbGVUVNLDYaJc%3Aru-matrix.org/%40voice2text%3Ahomeserver2.com?ver=1&ver=state-v2-test&ver=4&ver=3&ver=2 HTTP/1.0" "Synapse/0.99.5.2" [0 dbevts]

After adding 3 sec delay on remote bot side, it invites normally to my (new) room.

babolivier added a commit to babolivier/matrix-poll-bot that referenced this issue Jul 4, 2019
@MurzNN
Copy link

MurzNN commented Jul 24, 2019

Same problem with https://github.com/progserega/voice2textMatrix bot, adding 1sec delay workaround works well.

@richvdh richvdh added the A-Federated-Join joins over federation generally suck label Nov 16, 2020
@MadLittleMods
Copy link
Contributor

Related to #10066

@MadLittleMods MadLittleMods added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Federated-Join joins over federation generally suck T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

4 participants