-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Clients incorrectly denied permission to view some events #10369
Comments
Have you enabled the experimental Message retention policy feature or otherwise used the Purge History Admin API? Essentially this error will be returned if the server doesn't find any events for the client's context request: synapse/synapse/handlers/room.py Lines 1092 to 1094 in a683028
This can happen for a number of reasons. Perhaps the events have been purged using the above features/API, or all possible returnable events have been soft-failed (less likely). Did you notice this start happening immediately after running the state compressor, or immediately after an update - or has this been an ongoing problem? I'm not aware of any side effects of the state compressor that may cause what you're seeing, but it is possible. |
@anoadragon453 We started seeing this +/- after running the state compressor. Looking at the database, it seems that the events are still stored. It is also shown in a lot of direct messages. |
I have an update on this: I found one (!!) session that can actually read the old messages. All other sessions are getting denied. I have key backup configured to be on on all sessions. This might (probably is) an older session. How do sessions vs. users relate to being able to see events? |
That's odd, all the checks are done per-user and not per-device. Were the different sessions on different clients (e.g. web vs android)? I think this error is coming from: synapse/synapse/handlers/room.py Lines 1089 to 1091 in a743bf4
Are the users encountering this still in the room? Does jumping to other locations work? Can you check in the DB what event |
@erikjohnston As i am (luckily?) one of the affected users I can test and report first hand:
DB output:
|
Are you still in the room? I'd be interested in getting the state at that event. Do you have a manhole listener enabled? If so if you could ran the following commands in it (replacing
And copy the final output, which will tell us a) whether it thinks you were in the room at the time and b) the history visibility setting that is being used. If not I can find the necessary DB queries . |
@erikjohnston In the above python code,
There is no manhole listener configured. |
Ah, that only works in the manhole as described in: https://matrix-org.github.io/synapse/develop/manhole.html, which lets you ssh into a running Synapse and you get a python shell. |
Good morning @erikjohnston, below is the output:
|
Hi, thanks! Sorry, could you also do the last two lines? i.e.
|
Sorry, sure, here it is:
|
Thanks! Very interesting, so the history visibility is |
I think we have enough to try and investigate this |
A heads up from my side: originally this seemed to only affect one user, now we have about 5-10 users affected by this problem and it seems to impact working with matrix, as the rooms that cannot properly accessed turn up as rooms with "unread messages" and thus block the access to the rooms with real unread messages. |
Ping - is there anything we can do to analyse this problem? We are now having reports from some dozens of users and dozens of rooms. |
At this point we believe you've provided sufficient information, we just need to find time to dedicate a few days of engineering effort to further investigation. Oddly, we've not heard of this problem from other homeserver admins, which makes it challenging to prioritize, since it seems to be a local effect. |
@callahad If you have some pointers on where to start / where the source of problem is, we might be able to dive into it and submit a patch |
I suppose it might be worth throwing some debug into filter_events_for_client ? |
I have the same error message on iOS when scrolling through an encrypted chat history on a server that is not related to OPs server, so it might be a problem you will see a lot of very soon. It seems to happen by chance when scrolling, as the error message shows up at different places each time I try it. Not entirely sure it's related, though, as I'm not the server admin. Edit: Although it seems random, I have never been able to reach all the way to the first unread message, and the "Jump to unread" button doesn't work. |
We actually have a mix of Edit/note: I investigate ungleich's / Nico's server. |
An update: we have migrate to 1.60.0 some time ago, but the issue still persists. |
Description
Loading the start of the time timeline in some rooms fails.
Steps to reproduce
Note: this does not apply to all rooms, but in our instance to a lot of rooms.
Expectation: old events can always be loaded.
Further investigating shows that a request to
https://ungleich.matrix.ungleich.cloud/_matrix/client/r0/rooms/!qlfxvXwtSjmInWnicT%3Aungleich.ch/context/%24PsaDH5PnSV5u4lx3-06R2R9-vbDWUU8ErR2hOntC5e4?filter=%7B%22lazy_load_members%22%3Atrue%7D
fails with:
{"errcode":"M_FORBIDDEN","error":"You don't have permission to access that event."}
I first thought that might be related to us running matrix-org/rust-synapse-compress-state#27 , however we only compressed rooms with 10k+ events and many rooms that are much smaller are affected.
The users trying to access the events are often even an admin in the room, so a permission issue is unlikely.
Version information
If not matrix.org:
Version: {"server_version":"1.37.1","python_version":"3.7.3"}
Install method: package manager
Platform: Debian 10, no containers
The text was updated successfully, but these errors were encountered: