Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 404 in join from invite #5640

Closed
ulope opened this issue Jan 13, 2020 · 3 comments
Closed

Handle 404 in join from invite #5640

ulope opened this issue Jan 13, 2020 · 3 comments
Assignees

Comments

@ulope
Copy link
Collaborator

ulope commented Jan 13, 2020

Problem Definition

(Reported in #5504, thanks @nephix)

When the MatrixTransport receives in invite to a room with an invalid server name part (e.g. the server isn't in the federation whitelist (anymore) or the domain no longer exists) the Synapse server will respond with a MatrixRequestError: 404: {"errcode":"M_UNKNOWN","error":"No known servers"}.

We need to handle this case.

Ideally we'd also reject the invite to avoid re-receiving it on the next restart.

@fredo
Copy link
Contributor

fredo commented Feb 11, 2020

closed by #5709

@andrevmatos
Copy link
Contributor

I'm hitting this issue on current develop:

raiden3_1  | 2020-03-05 23:34:28.983738 [debug    ] Synchronized to a new confirmed block [raiden.raiden_service] event_filters_qty=50 greenlet_name=AlarmTask._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 sync_elapsed=datetime.timedelta(microseconds=594338)
raiden3_1  | Traceback (most recent call last):
raiden3_1  |   File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
raiden3_1  |   File "/app/venv/lib/python3.7/site-packages/raiden/network/transport/matrix/transport.py", line 503, in _process_queued_invites
raiden3_1  |     self._handle_invite(room_id, state)
raiden3_1  |   File "/app/venv/lib/python3.7/site-packages/raiden/network/transport/matrix/transport.py", line 967, in _handle_invite
raiden3_1  |     assert room is not None, f"joining room {room} failed"
raiden3_1  | AssertionError: joining room None failed
raiden3_1  | 2020-03-05T23:34:30Z <Greenlet "Greenlet<fn:_process_queued_invites>" at 0x7f76ef2b2ef0: <bound method MatrixTransport._process_queued_invites of <MatrixTransport node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 id:a9ae89a6-e224-4031-b865-e228e825fec8>>> failed with AssertionError
raiden3_1  |
raiden3_1  | 2020-03-05 23:34:30.108687 [error    ] Runnable subtask died!         [raiden.utils.runnable] exc=AssertionError('joining room None failed') running=True subtask=<Greenlet "Greenlet<fn:_process_queued_invites>" at 0x7f76ef2b2ef0: <bound method MatrixTransport._process_queued_invites of <MatrixTransport node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 id:a9ae89a6-e224-4031-b865-e228e825fec8>>> this=<MatrixTransport node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 id:a9ae89a6-e224-4031-b865-e228e825fec8>
raiden3_1  | 2020-03-05 23:34:30.111138 [debug    ] Matrix stopping                [raiden.network.transport.matrix.transport] current_user=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 transport_uuid=a9ae89a6-e224-4031-b865-e228e825fec8
raiden3_1  | 2020-03-05 23:34:30.112975 [debug    ] Health check worker exiting, stop is set [raiden.network.transport.matrix.transport] current_user=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network greenlet_name=Greenlet<fn:_health_check_worker> node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 transport_uuid=a9ae89a6-e224-4031-b865-e228e825fec8
raiden3_1  | 2020-03-05 23:34:30.114926 [debug    ] Handling worker exiting, stop is set [raiden.network.transport.matrix.client] greenlet_name=GMatrixClient.message_worker user_id:@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network node=0xfbdc476bc557b84caafd08735bf7d42d57717138
raiden3_1  | 2020-03-05 23:34:30.117107 [debug    ] Waiting on sync greenlet       [raiden.network.transport.matrix.client] greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xfbdc476bc557b84caafd08735bf7d42d57717138 user_id=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network
raiden3_1  | 2020-03-05 23:34:30.118738 [debug    ] Waiting on handle greenlet     [raiden.network.transport.matrix.client] current_user=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xfbdc476bc557b84caafd08735bf7d42d57717138
raiden3_1  | 2020-03-05 23:34:30.120128 [debug    ] Listener greenlet exited       [raiden.network.transport.matrix.client] greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xfbdc476bc557b84caafd08735bf7d42d57717138 user_id=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network
raiden3_1  | 2020-03-05 23:34:30.128168 [debug    ] Idle                           [raiden.utils.debugging] context_switches=82 greenlet_name= idle_pct=0.7913248426892773 idled=7.850895643234253 interval=9.921204566955566 start=1583451184.4808917
raiden3_1  | 2020-03-05 23:34:31.219956 [debug    ] Transport performance report   [raiden.network.transport.matrix.transport] counters={'send': [], 'retry': [], 'dispatch': []} current_user=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 message_ack_durations=[] node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 transport_uuid=a9ae89a6-e224-4031-b865-e228e825fec8
raiden3_1  | 2020-03-05 23:34:31.225879 [debug    ] Matrix stopped                 [raiden.network.transport.matrix.transport] config=MatrixTransportConfig(retries_before_backoff=1, retry_interval_initial=5.0, retry_interval_max=60.0, broadcast_rooms=['discovery', 'path_finding'], server='https://raidentransport.test001.env.raiden.network', available_servers=[], sync_timeout=60000, sync_latency=15000) current_user=@0xfbdc476bc557b84caafd08735bf7d42d57717138:raidentransport.test001.env.raiden.network greenlet_name=MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 transport_uuid=a9ae89a6-e224-4031-b865-e228e825fec8
raiden3_1  | Traceback (most recent call last):
raiden3_1  |   File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
raiden3_1  |   File "/app/venv/lib/python3.7/site-packages/raiden/network/transport/matrix/transport.py", line 515, in _run
raiden3_1  |     self._broadcast_worker()
raiden3_1  |   File "/app/venv/lib/python3.7/site-packages/raiden/network/transport/matrix/transport.py", line 741, in _broadcast_worker
raiden3_1  |     self._broadcast_event.wait(self._config.retry_interval_initial)
raiden3_1  |   File "src/gevent/event.py", line 133, in gevent._event.Event.wait
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 208, in gevent.__abstract_linkable.AbstractLinkable._wait
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 178, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 196, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 182, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 65, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
raiden3_1  | AssertionError: joining room None failed
raiden3_1  | 2020-03-05T23:34:31Z <Greenlet "MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138" at 0x7f76ef84c830: _run> failed with AssertionError
raiden3_1  |
raiden3_1  | 2020-03-05 23:34:31.240798 [error    ] Runnable subtask died!         [raiden.utils.runnable] exc=AssertionError('joining room None failed') running=True subtask=<Greenlet "MatrixTransport._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138" at 0x7f76ef84c830: _run> this=<RaidenService node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138>
raiden3_1  | 2020-03-05 23:34:31.244624 [debug    ] REST API stopping              [raiden.api.rest] greenlet_name=RaidenService._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 host=0.0.0.0 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 port=5001
raiden3_1  | 2020-03-05 23:34:31.247084 [debug    ] REST API stopped               [raiden.api.rest] greenlet_name=RaidenService._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 host=0.0.0.0 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138 port=5001
raiden3_1  | 2020-03-05 23:34:31.248790 [debug    ] Alarm task stopped             [raiden.tasks] greenlet_name=RaidenService._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138
raiden3_1  | 2020-03-05 23:34:31.255171 [debug    ] Raiden Service stopped         [raiden.raiden_service] greenlet_name=RaidenService._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138 node=0xFbDC476bC557B84cAAfd08735BF7D42d57717138
raiden3_1  | Traceback (most recent call last):
raiden3_1  |   File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
raiden3_1  |   File "/app/venv/lib/python3.7/site-packages/raiden/raiden_service.py", line 397, in _run
raiden3_1  |     self.stop_event.wait()
raiden3_1  |   File "src/gevent/event.py", line 133, in gevent._event.Event.wait
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 208, in gevent.__abstract_linkable.AbstractLinkable._wait
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 178, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 196, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_abstract_linkable.py", line 182, in gevent.__abstract_linkable.AbstractLinkable._wait_core
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/_greenlet_primitives.py", line 65, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
raiden3_1  |   File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
raiden3_1  | AssertionError: joining room None failed
raiden3_1  | 2020-03-05T23:34:31Z <Greenlet "RaidenService._run node:0xFbDC476bC557B84cAAfd08735BF7D42d57717138" at 0x7f76ef2b2830: _run> failed with AssertionError
raiden3_1  |
raiden3_1  | FATAL: An unexpected exception occured. A traceback has been written to /tmp/raiden-exception-2020-03-05T23-34e4_cegl5.txt
raiden3_1  | joining room None failed
raiden3_1  | ReturnCode.FATAL```

@andrevmatos andrevmatos reopened this Mar 5, 2020
@karlb
Copy link
Contributor

karlb commented Nov 11, 2021

We don't use matrix rooms, anymore.

@karlb karlb closed this as completed Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants