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

Traceback: <class 'psycopg2.errors.CardinalityViolation'>: more than one row returned by a subquery used as an expression #6696

@anoadragon453

Description

@anoadragon453

Description

I seem to be failing to handle a few PDUs sent to me due to an issue in federation_sender

2020-01-13 12:35:13,435 - synapse.federation.federation_server - 246 - ERROR - PUT-280-$yg09yrsnWzyLftl-ygdO78GhGLs0iKOb038VZVNZ8Lg- Failed to handle PDU $yg09yrsnWzyLftl-ygdO78GhGLs0iKOb038VZVNZ8Lg
Traceback (most recent call last):
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/handlers/federation.py", line 279, in on_receive_pdu
    origin, pdu, prevs, min_depth
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/handlers/federation.py", line 544, in _get_missing_events_for_pdu
    await self.on_receive_pdu(origin, ev, sent_to_us_directly=False)
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/handlers/federation.py", line 422, in on_receive_pdu
    await self._process_received_pdu(origin, pdu, state=state)
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/handlers/federation.py", line 700, in _process_received_pdu
    context = await self._handle_new_event(origin, event, state=state)
twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback: <class 'psycopg2.errors.CardinalityViolation'>: more than one row returned by a subquery used as an expression

...

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/federation/federation_server.py", line 235, in process_pdus_for_room
    await self._handle_received_pdu(origin, pdu)
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/federation/federation_server.py", line 629, in _handle_received_pdu
    await self.handler.on_receive_pdu(origin, pdu, sent_to_us_directly=True)
  File "/home/synapse/synapse/env/lib/python3.7/site-packages/synapse/handlers/federation.py", line 284, in on_receive_pdu
    % (event_id, e)
Exception: Error fetching missing prev_events for $yg09yrsnWzyLftl-ygdO78GhGLs0iKOb038VZVNZ8Lg: FirstError[#0, [Failure instance: Traceback: <class 'psycopg2.errors.CardinalityViolation'>: more than one row returned by a subquery used as an expression

Version information

Synapse v1.8.0

Edit: It turns out, when this happens, it's possible for the code that sends dummy events for fixing forward extremities to break. Thus, your server can build up forward extremities to the point where your server starts to churn and take up vast amounts of RAM and CPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    z-bug(Deprecated Label)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions