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

Error: Event has no state groups #3601

Closed
turt2live opened this issue Jul 25, 2018 · 3 comments
Closed

Error: Event has no state groups #3601

turt2live opened this issue Jul 25, 2018 · 3 comments

Comments

@turt2live
Copy link
Member

turt2live commented Jul 25, 2018

Unclear severity. This is on the develop branch as of writing. Happens to several events in different rooms at different times (not a pattern).

er - 2018-07-25 06:20:39,274 - synapse.storage.events - 422 - INFO - Calculating state delta for room !redacted:matrix.org
homeserver - 2018-07-25 06:20:39,275 - synapse.util.async - 250 - INFO - Releasing linearizer lock 'fed_room_pdu' for key '!redacted:matrix.org'
homeserver - 2018-07-25 06:20:39,275 - synapse.federation.federation_server - 194 - ERROR - Failed to handle PDU $redacted:matrix.org: Traceback (most recent call last):
--- <exception caught here> ---
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/federation/federation_server.py", line 183, in process_pdus_for_room
    transaction.origin, pdu
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/federation/federation_server.py", line 605, in _handle_received_pdu
    origin, pdu, get_missing=True, sent_to_us_directly=True,
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/handlers/federation.py", line 213, in on_receive_pdu
    origin, pdu, prevs, min_depth
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/handlers/federation.py", line 366, in _get_missing_events_for_pdu
    get_missing=False
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/handlers/federation.py", line 290, in on_receive_pdu
    auth_chain=auth_chain,
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/handlers/federation.py", line 444, in _process_received_pdu
    yield self._handle_new_events(origin, event_infos)
  File "/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/handlers/federation.py", line 1525, in _handle_new_events
    backfilled=backfilled,
twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback: <type 'exceptions.Exception'>: Context for new extremity event $redacted:matrix.org has no state group
/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py:1418:_inlineCallbacks
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:432:_persist_events
/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py:1613:unwindGenerator
/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py:1529:_cancellableInlineCallbacks
--- <exception caught here> ---
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:149:handle_queue_loop
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:293:persisting_queue
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:188:f
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:432:_persist_events
/home/matrix/.synapse/local/lib/python2.7/site-packages/twisted/internet/defer.py:1418:_inlineCallbacks
/home/matrix/.synapse/local/lib/python2.7/site-packages/synapse/storage/events.py:581:_get_new_state_after_events
]]
homeserver - 2018-07-25 06:20:39,283 - synapse.util.logcontext - 273 - WARNING - Expected logging context persist_events@7fccd36db488 has been lost
erikjohnston added a commit that referenced this issue Jul 25, 2018
We incorrectly asserted that all contexts must have a non None state
group without consider outliers. This would usually be fine as the
assertion would never be hit, as there is a shortcut during persistence
if the forward extremities don't change.

However, if the outlier is being persisted with non-outlier events, the
function would be called and the assertion would be hit.

Fixes #3601
@erikjohnston
Copy link
Member

The linked PR should fix this.

Broadly this was happening when we were persisting outlier events during the same persist event loop as non-outlier events for the room. The non-outlier events forced it down the code path of recalculating current state, at which point we asserted that all event contexts must have a state group. Outlier events don't have a state group.

@richvdh
Copy link
Member

richvdh commented Jul 25, 2018

(the logcontext leak is fixed in #3606)

@turt2live
Copy link
Member Author

Looks like #3603 did fix it. Also the log context warning is gone. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants