mautrix / meta

A Matrix-Facebook Messenger and Instagram DM puppeting bridge.
GNU Affero General Public License v3.0
155 stars 11 forks source link

failed to get group session: group session has been withheld: com.beeper.redacted (Session redacted: expired) #50

Closed kevincox closed 4 months ago

kevincox commented 4 months ago

When trying to send messages the bot was responding with:

⚠ Your message was not bridged: failed to get group session: group session has been withheld: com.beeper.redacted (Session redacted: expired).

I tried a few times with the same problem. After restarting the bridge everything seemed back to normal.

Logs

There weren't really any logs. Just the one error that was also presented in the response from the bot. I've included a few previous log messages but they are quite a bit before I sent the message that failed to get bridged.

{"level":"error","user_id":"REDACTED","component":"messagix","error":"error in read loop: failed to read message: websocket: close 1006 (abnormal closure): unexpected EOF","reconnect_in":2000,"time":"2024-04-14T19:59:09.843817066Z","message":"Error in connection, reconnecting"}
{"level":"warn","user_id":"REDACTED","component":"messagix","database_id":1,"payload":"{\"database\":1,\"last_applied_cursor\":\"REDACTED\",\"sync_params\":null,\"epoch_id\":REDACTED,\"version\":REDACTED,\"failure_count\":null}","response":{"request_id":30,"payload":"{\"name\":null,\"step\":[1,[1],[1,[5,\"updateLastSyncCompletedTimestampMsToNow\",[19,\"1\"]]],[1]]}","sp":["updateLastSyncCompletedTimestampMsToNow"],"target":3},"table":{"LSUpdateLastSyncCompletedTimestampMsToNow":[{"Unknown0":1}]},"time":"2024-04-14T19:59:23.177764966Z","message":"No transactions found"}
{"level":"error","user_id":"REDACTED","component":"messagix","error":"failed to make lightspeed socket request with DatabaseQuery byte payload (databaseId=2): publish response timeout","database_id":2,"time":"2024-04-14T19:59:52.927456714Z","message":"Failed to sync database through socket"}
{"level":"warn","event_id":"REDACTED","session_id":"REDACTED","error":"failed to get group session: group session has been withheld: com.beeper.redacted (Session redacted: expired)","time":"2024-04-14T21:16:31.439353574Z","message":"Failed to decrypt event"}

Version: https://github.com/mautrix/meta/commit/61f9c3985d2025d3dd89a8ee4a8a9e95e2961c81

tulir commented 4 months ago

That's a client bug, it means the client used a megolm session that's too old (by default the expiry is 1 week and the bridge deletes sessions that are >2x the expiry, so the session was at least 2 weeks old)

kevincox commented 4 months ago

Yes, it seems that you are right. I tried after restart with a different client. Trying again with the original client (Element Android) still fails. The bridge was set up just over 2 weeks ago so I guess keys were never refreshed.

hafeoz commented 1 month ago

For anyone suffering the same issue: AFAIK it only affects Element Android, and refreshing session by sending /discardsession in the room seems to mitigate it.