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

delete_old_current_state_events background update can race with room creation, causing "no create event in auth events" #7834

Closed
richvdh opened this issue Jul 13, 2020 · 2 comments · Fixed by #7854

Comments

@richvdh
Copy link
Member

richvdh commented Jul 13, 2020

As demonstrated in the logs of this test run:

2020-07-09 09:21:24,875 - synapse.storage.background_updates - 227 - INFO - background_updates-0 - Starting update batch on background update 'delete_old_current_state_events'
2020-07-09 09:21:24,884 - synapse.storage.data_stores.main.state - 383 - INFO - background_updates-0 - Deleting current state left rooms: {'!TKNXvIHTmAsiwecNYO:localhost:8800'}
2020-07-09 09:21:24,887 - synapse.storage.background_updates - 269 - INFO - background_updates-0 - Running background update 'delete_old_current_state_events'. Processed 100 items in 10ms. (total_rate=0/ms, current_rate=0/ms, total_updated=0, batch_size=100)
2020-07-09 09:21:24,923 - synapse.handlers.message - 829 - WARNING - POST-125 - Denying new event <FrozenEventV3 event_id='$It51s0T01y0gj9QnUhghGAfoC5H762-I0Dn-q9fm59w', type='m.room.member', state_key='@anon-20200709_092116-20:localhost:8800'> because 403: No create event in auth events
2020-07-09 09:21:24,923 - synapse.http.server - 74 - INFO - POST-125 - <SynapseRequest at 0x7f9a25cb5ac8 method='POST' uri='/_matrix/client/r0/createRoom?access_token=<redacted>' clientproto='HTTP/1.1' site=8800> SynapseError: 403 - No create event in auth events
2020-07-09 09:21:24,924 - synapse.access.https.8800 - 312 - INFO - POST-125 - 127.0.0.1 - 8800 - {@anon-20200709_092116-20:localhost:8800} Processed request: 0.081sec/0.000sec (0.007sec, 0.003sec) (0.039sec/0.008sec/15) 66B 403 "POST /_matrix/client/r0/createRoom?access_token=<redacted> HTTP/1.1" "Perl + Net::Async::HTTP/0.47" [0 dbevts]
  • createRoom makes the m.room.create event and adds it to current_state_events
  • delete_old_current_state_events runs, and sees a room with no active membership events
  • createRoom tries to add the creator's membership event, but there is no create event in the current state, leading to the observed error.
@richvdh
Copy link
Member Author

richvdh commented Jul 13, 2020

richvdh added a commit that referenced this issue Jul 15, 2020
When considering rooms to clean up in `delete_old_current_state_events`, skip
rooms which we are creating, which otherwise look a bit like rooms we have
left.

Fixes #7834.
@richvdh
Copy link
Member Author

richvdh commented Jul 15, 2020

introduced by #6802.

richvdh added a commit that referenced this issue Jul 15, 2020
When considering rooms to clean up in `delete_old_current_state_events`, skip
rooms which we are creating, which otherwise look a bit like rooms we have
left.

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

Successfully merging a pull request may close this issue.

1 participant