matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.79k stars 2.13k forks source link

ObservableDeferred is not iterable #7087

Closed IngwiePhoenix closed 4 years ago

IngwiePhoenix commented 4 years ago

Description

I have been running Synapse for about a month now and just traveled up and down a few server's room lists via Riot and wanted to join a couple. Well, either I am literally over-tasking my server, or I found an actual bug. I don't exactly know which of the two it is, but since this is unexpected behaviour, I thought I'd let you guys know.

Steps to reproduce

From what I know, this is about when I try to /join a room through Riot. The room shouldn't matter, but it is #gamingonlinux:matrix.org.

Log:

2020-03-16 15:51:21,944 - synapse.access.http.8008 - 302 - INFO - PUT-1738425 - 198.245.63.94 - 8008 - {@_discord_324631108731928587:ingwie.io} Processed request: 0.002sec/0.001sec (0.004sec, 0.000sec) (0.000sec/0.000sec/0) 2B 200 "PUT /_matrix/client/r0/presence/%40_discord_324631108731928587%3Aingwie.io/status?access_token=<redacted>&user_id=%40_discord_324631108731928587%3Aingwie.io HTTP/1.0" "-" [0 dbevts]     2020-03-16 15:51:22,275 - synapse.access.http.8008 - 302 - INFO - GET-1738418 - 2a02:908:c37:9a20:65f3:c170:5a83:a4c5 - 8008 - {@ingwiephoenix:ingwie.io} Processed request: 2.558sec/0.003sec (0.008sec, 0.000sec) (0.000sec/0.000sec/0) 491B 200 "GET /_matrix/client/r0/sync?filter=0&timeout=30000&since=s126525_4944167_17371_26878_2214_3_2_4306_2 HTTP/1.0" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.130 Safari/537.36" [0 dbevts]
2020-03-16 15:51:22,335 - synapse.access.http.8008 - 302 - INFO - PUT-1738368 - 149.248.189.70 - 8008 - {tylerfreedman.com} Processed request: 11.334sec/0.000sec (0.012sec, 0.000sec) (10.758sec/0.556sec/3) 12B 200 "PUT /_matrix/federation/v1/send/1583436493074 HTTP/1.0" "Synapse/1.0.0" [0 dbevts]
2020-03-16 15:51:22,432 - synapse.access.http.8008 - 302 - INFO - GET-1738428 - 2a02:908:c37:9a20:65f3:c170:5a83:a4c5 - 8008 - {@ingwiephoenix:ingwie.io} Processed request: 0.022sec/0.003sec (0.004sec, 0.000sec) (0.000sec/0.000sec/0) 490B 200 "GET /_matrix/client/r0/sync?filter=0&timeout=30000&since=s126625_4944168_17371_26878_2214_3_2_4306_2 HTTP/1.0" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.130 Safari/537.36" [0 dbevts]
2020-03-16 15:51:22,542 - synapse.federation.federation_server - 832 - ERROR - PUT-1738389 - Failed to handle edu 'm.receipt'
Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
StopIteration: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/federation/federation_server.py", line 828, in on_edu
    await handler(origin, content)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/handlers/receipts.py", line 65, in _received_remote_receipt
    await self._handle_new_receipts(receipts)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/handlers/receipts.py", line 79, in _handle_new_receipts
    receipt.data,
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/python/failure.py", line 512, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/storage/data_stores/main/receipts.py", line 473, in insert_receipt
    stream_id=stream_id,
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/storage/database.py", line 499, in runInteraction
    after_callback(*after_args, **after_kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.5/site-packages/synapse/storage/data_stores/main/receipts.py", line 310, in _invalidate_get_users_with_receipts_in_room
    if res and user_id in res:
TypeError: argument of type 'ObservableDeferred' is not iterable

Version information

richvdh commented 4 years ago

The ObservableDeferred error is #3234. It's unlikely it's stopping you joining rooms. If you can't join any rooms, the first place to get help is probably #synapse:matrix.org. if it's limited to particular rooms, please can you open a new bug explaining what exactly you see in the client, and sharing a link to your logfiles for a much longer period (note that it can take some time to join a large room).