Improve We can't get valid state history. logging#19765
Merged
MadLittleMods merged 3 commits intoMay 13, 2026
Merged
Conversation
MadLittleMods
commented
May 8, 2026
| logger.info( | ||
| "Event %s is missing prev_events %s: calculating state for a " | ||
| "backwards extremity", | ||
| "_compute_event_context_with_maybe_missing_prevs(event_id=%s): Event in room %s is missing prev_events %s: " |
Contributor
Author
There was a problem hiding this comment.
These log messages can be refactored to not use the _compute_event_context_with_maybe_missing_prevs prefix if there is a strong preference.
Being able to search for _compute_event_context_with_maybe_missing_prevs sounds nice to me.
MadLittleMods
commented
May 8, 2026
| event_id, | ||
| room_id, | ||
| shortstr(missing_prevs), | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
Example logs:
SYNAPSE_TEST_LOG_LEVEL=DEBUG poetry run trial tests.handlers.test_federation_event.FederationEventHandlerTests.test_process_pulled_event_records_failed_backfill_attempts
_trial_temp/test.log
2026-05-08 07:18:38-0500 [-] synapse.handlers.federation_event - 1168 - INFO - test - _compute_event_context_with_maybe_missing_prevs(event_id=$C9yIQdfmuUAMM7Iziu5xft5kkFCRXdjPsBleizH0MBU): Event in room !tZrGbzfBcdXoJtzfLn:test is missing prev_events ['$fake_prev_event']: calculating state for a backwards extremity
2026-05-08 07:18:38-0500 [-] synapse.handlers.federation_event - 1191 - INFO - test - _compute_event_context_with_maybe_missing_prevs(event_id=$C9yIQdfmuUAMM7Iziu5xft5kkFCRXdjPsBleizH0MBU): Requesting state from other.example.com for missing prev_event $fake_prev_event
2026-05-08 07:18:38-0500 [-] synapse.handlers.federation_event - 1233 - WARNING - test - _compute_event_context_with_maybe_missing_prevs(event_id=$C9yIQdfmuUAMM7Iziu5xft5kkFCRXdjPsBleizH0MBU): Error attempting to resolve state from other.example.com for missing prev_events: Unable to get missing prev_event $fake_prev_event
erikjohnston
approved these changes
May 13, 2026
Member
erikjohnston
left a comment
There was a problem hiding this comment.
Seems like decent improvements
Contributor
Author
|
Thanks for the review @erikjohnston 🐩 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve
We can't get valid state history.logging. Addevent_idso you can actually correlate everything together in the logs.Spawning from @jakobrss asking about what to look for when someone encounters this error
Dev notes
These logs originate from matrix-org/synapse#3904 where they used to have the
room_idandevent_idincluded directly but then was updated in matrix-org/synapse#9596 to rely on the log context holding this info.Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.