mollyim / mollyim-android

Enhanced and security-focused fork of Signal.
GNU Affero General Public License v3.0
1.58k stars 86 forks source link

App crashes after turning on chat backup on linked device #219

Closed taivlam closed 9 months ago

taivlam commented 1 year ago

Is there an existing issue for this?

Bug description

Molly crashes after I activated chat backups on my linked device, a Pixel Tablet running GrapheneOS.

I have the local database passphrase on, so I have to enter it. However, after successfully entering it, Molly will accept messages for a very short amount of time (much less than 1-2 seconds) before crashing.

I've attached the debug log file ZIP to this issue.

After trying to unlock Molly a few times with the same results, I also got this Android system crash message:

type: crash
osVersion: google/tangorpro/tangorpro:13/TQ3A.230901.001.B1/2023091800:user/release-keys
package: im.molly.app:133700
process: im.molly.app
processUptime: 39744 + 242 ms
installer: app.accrescent.client

org.thoughtcrime.securesms.recipients.RecipientId$InvalidStringRecipientIdError
        at org.thoughtcrime.securesms.recipients.RecipientId.from(RecipientId.java:52)
        at org.thoughtcrime.securesms.profiles.AvatarHelper$1.next(AvatarHelper.java:78)
        at org.thoughtcrime.securesms.profiles.AvatarHelper$1.next(AvatarHelper.java:67)
        at org.thoughtcrime.securesms.backup.FullBackupExporter.internalExport(FullBackupExporter.java:190)
        at org.thoughtcrime.securesms.backup.FullBackupExporter.export(FullBackupExporter.java:119)
        at org.thoughtcrime.securesms.jobs.LocalBackupJobApi29.onRun(LocalBackupJobApi29.java:143)
        at org.thoughtcrime.securesms.jobs.BaseJob.run(BaseJob.java:31)
        at org.thoughtcrime.securesms.jobmanager.JobRunner.run(JobRunner.java:86)
        at org.thoughtcrime.securesms.jobmanager.JobRunner.run(JobRunner.java:49)
        at [[ ↑↑ Original Trace ↑↑ ]].(:0)
        at [[ ↓↓ Exception Message ↓↓ ]].(:0)
        at null.(:0)

This was also happening on my Pixel 5a (barbet) running the latest version of GrapheneOS 6 days ago, with Molly v6.31.2-2.

I am not sure what to do, as I was excited to use Molly as a linked device on the Pixel Tablet; but this really threw a wrench into my plans for that.

Steps to reproduce

  1. Turn on chat backup on linked Molly device
  2. Molly crashes (which isn't supposed to happen)
  3. Try to open Molly again, enter local database passphrase if needed
  4. Molly opens up shortly and receives messages for about 1-2 seconds
  5. Molly crashes again
  6. Repeating Steps 3-5 is practically an endless loop, w.r.t. procedure steps

Molly version

v6.34.5-1

Android version

GrapheneOS, Android 13 (version 2023091800)

Device

Pixel Tablet (tangorpro)

Link to debug log

(see above for debug log; the steps for accessing the debug log no longer produce a URL anymore in Molly)

valldrac commented 11 months ago

Thanks for the bug report!

I wanted to let you know that we've just released Molly 6.35.3-1, which includes a fix to address this issue. If you have a moment, please update to the latest version and let us know if the issue has been resolved.

cc @akki42

taivlam commented 11 months ago

Before I test the Pixel Tablet again, I wanted to say this: somehow an existing Molly client that already has chat backup enabled was fine and did not crash when converting it from a primary Android device to a linked Android device.

This happened when I switched from the Pixel 4a to the Pixel 5a this weekend (as Pixel 4a is on Extended Release Support and I wanted to make sure I received the GrapheneOS upgrade to Android 14).

akki42 commented 11 months ago

Hi @valldrac, Thank you for your support. I just tested with 6.35.3-1, but unfortunately, backup still fails. But now, the error message (to me) looks more specific - it seems to be a directory permission problem. Please see full debug log at https://debuglogs.org/android/6.35.3/7f3c83cc0e8e964d950681e8815d4516a81a3b0bcfc256b74740d50d48871ca1 (I am running current LineageOS 13 on a Samsung Tab S5e - gts4lv.) Happy to provide further info if needed.

taivlam commented 11 months ago

@valldrac Unfortunately, similar to what @akki42 discovered, the issue persists after I updated Molly to version 6.35.3-1 (and GrapheneOS to Android 14) on the Pixel Tablet. This is when I'm trying to set up Molly up with chat backups enabled from the ground up on a completely new Android device.

Here is the debug log file, after my second attempt: molly-log-1697075682265.zip

However, I haven't been able to get an Android OS system prompt describing any error when this issue crashes Molly now.

taivlam commented 11 months ago

I tested the Pixel Tablet, by setting up my primary Molly device from the Pixel 5a to the Pixel Tablet (via a full encrypted local backup) for about 10 minutes; then I switched the primary Molly device from the Pixel Tablet to the Pixel 5a. I then "re-logged into" Molly on the Pixel Tablet using the secondary Android device feature.

When this happened, the Pixel Tablet can function normally; and the Chat Backup passphrase is identical between the Pixel 5a and Pixel Tablet.

I'm surmising that there may be something going on with the actual local encrypted Molly/Signal backup. Before, when I was setting up Molly as a secondary device on the Pixel Tablet, everything was fine - up until I activated Chat Backups. In this case, the chat backup passphrase (i.e., the randomly generated string of numbers) on the Pixel Tablet as a secondary device was different than the chat backup passphrase on the Pixel 5a as the primary Molly client.

Would anything bad happen if the passphrase for the chat backups differed between the primary Molly client and secondary Molly clients?

valldrac commented 10 months ago

@akki42: The fix for the problem you reported, the InvalidStringRecipientIdError crash, wasn't quite fixed in version 6.35.3-1. I think it's all good now starting from 6.38.2-1.

akki42 commented 10 months ago

Hi @valldrac , Thanks for your support. Unfortunately, v 6.39.2-1 still crashes, see https://debuglogs.org/android/6.39.2/0c1802c2316f4d2c723cf593094b9c8b1c68f87a09eb675454a171d0c9e7e495 .

valldrac commented 10 months ago

Unfortunately, v 6.39.2-1 still crashes,

Alright. This bug is being stubborn. I'll try a different approach in the next release.

valldrac commented 9 months ago

In the latest version v6.41.3-2, it should be fixed.

taivlam commented 9 months ago

Thank you, this feature is now working!

I had to manually remove the Pixel Tablet as a linked device, and then re-add the Pixel Tablet as a secondary device; but this is likely due to the fact I last logged into Molly on the Pixel Tablet over 2 months ago.)