Cannot decrypt messages from specific user sent using specific device: `Unable to decrypt: OLM`
See original GitHub issueDescribe the bug
When using Element Android on a phone running Android 10, E2E messages received from one specific device belonging to another user are not immediately viewable. Instead, Waiting for this message, this may take a while
is seen in place of the message contents, or ** Unable to decrypt: OLM **
when Developer mode is turned on in Element’s advanced settings.
To Reproduce
A room exists consisting of me and my friend Ed, each using our own, self-hosted Synapse homeservers. We have not tested for this issue in other rooms.
Steps to reproduce the behavior:
- Ed uses his phone to send a message to this room.
- I observe the following:
a. On my phone running Android 10: Often
Unable to decrypt: OLM
is shown in place of the message contents. Otherwise, the message contents are visible, as expected. b. On my phone running Android 6: The message contents are visible, as expected. c. On my computer with Element Desktop: The message contents visible, as expected.
For comparison, we tested the following:
- Ed uses his computer with Element Desktop to send a message to this room.
- I observe the following: a. On my phone running Android 10: The message contents visible, as expected. b. On my phone running Android 6: The message contents are visible, as expected. c. On my computer with Element Desktop: The message contents are visible, as expected.
We also tested:
- I use my Android 10 phone to send a message to this room.
- On Ed’s phone: The message contents are visible, as expected.
Finally, we tested:
- In a new room, without E2E enabled, Ed uses his phone to send a message to the room.
- I observe the following: a. On my phone running Android 10: The message contents are visible, as expected. b. On my phone running Android 6: The message contents are visible, as expected. c. On my computer with Element Desktop: The message contents are visible, as expected.
Each test consisted of Ed (or myself) sending multiple messages in quick succession, and the ‘failure’ rate for my ability to view messages on the affected phone was 100%. But under normal, “real life” circumstances (i.e. an actual conversation), this only occurred once every few messages.
I’ve concluded that this issue only affects messages sent from Ed’s phone when they’re viewed on my Android 10 phone, and in a room with E2E enabled.
On the affected (Android 10) phone, logs were captured using logcat
over adb
. The following is shown repeatedly when affected messages are received:
05-24 21:55:02.212 27914 1430 E OlmJniNative: ## decryptMessageJni(): failure - olm_group_decrypt Msg=BAD_MESSAGE_MAC
05-24 21:55:02.212 27914 1430 E OlmInboundGroupSession: ## decryptMessage() failed BAD_MESSAGE_MAC
The affected messages eventually become visible on the Android 10 phone, but I have not figured out how long the delay actually is. It appears to be greater than a few hours.
This issue has not affected communications with any other users yet.
Expected behavior
When Ed sends me a message, it will be viewable on every device I have Element and E2E correctly set up on in a reasonable amount of time, regardless of which of his devices he uses to send it.
Screenshots
Screenshots have been attached.
Smartphone (please complete the following information):
My phone affected by this issue
- Device: Motorola Moto Z3 Play
- OS: Android 10 (LineageOS 17.1, official, build 17.1-20210303-NIGHTLY-beckham)
My phone unaffected by this issue
- Device: Motorola Moto X
- OS: Android 6 (LineageOS 14, unofficial, self-built)
Ed’s phone
- Device: Google Pixel 3
- OS: Android 11
Additional context
- Using Element Android: 1.1.7 via Google Play (Applies to all phones listed above)
- Homeserver: matrix.calvinrw.com (Synapse 1.34)
- Ed’s homeserver: Synapse 1.34
- Two rageshakes were submitted on 2021-05-23
- This issue did not occur prior to 2021-05-05, and started occurring consistently after 2021-05-10.
- E2E appears to be set up correctly on all devices, because Element shows the green shield for this room. We have verified each other, and all of our sessions are verified.
- Before and during the tests described above, both of my phones were kept awake using LineageOS’s caffeine feature, so Android’s power management was not a factor.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:15 (6 by maintainers)
Top GitHub Comments
I seem to have this issue, where I am always one message behind in comparison to desktop in the only room this happens in. As soon as the other party sends another encrypted messages, the “Unable to decrypt: OLM” becomes visible, but that next message becomes “Unable to decrypt: OLM” once more.
Ed here from the original issue report.
We are now seeing the same issue in reverse. I am unable to see calvinrw’s messages on Android with the same error message, but the same message comes through okay on the Element web client.
We are both now on Android Element version 1.1.9.