element-hq / element-hq/synapse

Unexpectedly did not have cached prev group for <Event ID>

Open
#16,118 0 comments 0 reactions 0 assignees View on GitHub
A-E2EE O-Occasional S-Major T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#16118](https://github.com/matrix-org/synapse/issues/16118).

---

### Description

Some messages end up not being able to be decrypted by clients. The event ID that is not decryptable by clients corresponds with the message `Unexpectedly did not have cached prev group for ` in the log.

### Steps to reproduce

End-to-end encrypted rooms

### Homeserver

passwordclass.xyz

### Synapse Version

{"server_version":"1.89.0","python_version":"3.10.12"}

### Installation Method

Other (please mention below)

### Database

PostgreSQL, single server, did not port from SQLite, have previously restored from a backup (dump & restore to upgrade from PostgreSQL 14 -> 15)

### Workers

Single process

### Platform

OpenBSD 7.3-CURRENT

### Configuration

No unusual configs.

### Relevant log output

```shell
2023-08-15 21:03:42,769 - synapse.federation.sender - 586 - INFO - process_event_queue_for_federation-276 - Unexpectedly did not have cached prev group for

Following log info doesn't appear to be immediately relevant. But it is followed by:

2023-08-15 21:03:42,782 - synapse.push.httppusher - 230 - INFO - httppush.process-316 - Processing 1 unprocessed push actions for
```

### Anything else that would be useful to know?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the synapse.federation.sender log entry and trace how the cached previous group is populated and consumed for end-to-end encrypted events. Reproduce the failure if possible using the reported federation and encryption conditions, then define completion as preventing the missing-cache condition or handling it so affected messages remain decryptable, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
backend, distributed-systems, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.