signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.52k stars 6.11k forks source link

App crashes on each start after pairing with new device #13603

Closed fgubler closed 3 weeks ago

fgubler commented 3 months ago

Let's begin with a checklist: Replace the empty checkboxes [ ] below with checked ones [x] accordingly. -->


I have created this issue based on Issue 13255 because starting with Comment by mxjp we inadvertantly started talking about a new bug which was separate from the one orginally described in that ticket. The tickets original creator made us aware of this, so here we are.

Bug description

After connecting a new device (Signal Desktop on a Ubuntu machine in my case), the Signal app on my Android smartphone (Android 14, Samsung Galaxy S22) started immediately crashing whenever the app was opened in the foreground.

For me, it was an Ubuntu client to which I newly connected. But other people have mentioned it happening to them on Mac clients as well.

Bug Analysis

Things which I tried but did not work

On the other hand, Signal worked perfectly fine under the following circumstances

My conclusion: some data stored for my account on the server got corrupted. My guess would be that some table storing the list of connected devices got corrupted. So at each start, the app would ask the server about that list and crash due to the invalid data that was returned. (but that is ofc just my primitive theory)

Steps to reproduce

Actual result: The android app crashing on each start. Expected result: The app not crashing but letting me use it :-).

Very primitive workaround

After a few uninstallations and re-installations, I finally found a hint online which allowed me to get out of the broken state of my Signal-account. As a result I am now able to use the app again and could even restore a backup. Therefore, I only lost the messages of 1 day. Obviously, a fixed would still be very welcome.

Step-by-step guide of what I did to get out of the frying pan.

  1. Started Signal in Flight-Mode
  2. Started Signal and went to Settings - Account
  3. Disabled the Registration Lock
    • This requires an internet-connection, so while on the correct screen, I disabled flight-mode and immediately pressed the slider.
    • This made the app crash but not before the setting hat been changed
  4. Re-started the app and went to Settings - Account - Advanced PIN settings and clicked Disable PIN
    • This needs an internet-connection again but you can already click the button and then a loading-bar appears. While that is turning, disable flight-mode.
    • That should then work and the app should stop crashing.

If you have never uninstalled and re-installed the app or have already re-applied your backups, this might be enough for you and you can skip the next few steps and just set a new PIN. But for me, I went a bit further to get my old chats back.

Device info

Device: Samsung Galaxy S22 Android version: 14 Signal version: 7.8.1

Errors from ADB logcat

2024-06-22 16:25:58.241 10745-10806 AndroidRuntime          org.thoughtcrime.securesms           E  FATAL EXCEPTION: signal-JobRunner-2
                                                                                                    Process: org.thoughtcrime.securesms, PID: 10745
                                                                                                    java.lang.AssertionError: Must have a storage key!
                                                                                                        at org.thoughtcrime.securesms.storage.StorageSyncModels.localToRemoteRecord(StorageSyncModels.java:51)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.lambda$getMatching$0(GroupV2RecordProcessor.java:60)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.$r8$lambda$l2yNsjTahNRscgMBxviGyETokOQ(GroupV2RecordProcessor.java:0)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor$$ExternalSyntheticLambda0.apply(R8$$SyntheticClass:0)
                                                                                                        at j$.util.Optional.map(SourceFile:0)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.getMatching(GroupV2RecordProcessor.java:54)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.getMatching(GroupV2RecordProcessor.java:22)
                                                                                                        at org.thoughtcrime.securesms.storage.DefaultStorageRecordProcessor.process(DefaultStorageRecordProcessor.java:51)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.process(GroupV2RecordProcessor.java:22)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.processKnownRecords(StorageSyncJob.java:412)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.performSync(StorageSyncJob.java:293)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.onRun(StorageSyncJob.java:194)
                                                                                                        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)
2024-06-22 16:25:58.242 10745-10806 SignalUncaughtException org.thoughtcrime.securesms           E  java.lang.AssertionError: Must have a storage key!
                                                                                                        at org.thoughtcrime.securesms.storage.StorageSyncModels.localToRemoteRecord(StorageSyncModels.java:51)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.lambda$getMatching$0(GroupV2RecordProcessor.java:60)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.$r8$lambda$l2yNsjTahNRscgMBxviGyETokOQ(GroupV2RecordProcessor.java:0)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor$$ExternalSyntheticLambda0.apply(R8$$SyntheticClass:0)
                                                                                                        at j$.util.Optional.map(SourceFile:0)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.getMatching(GroupV2RecordProcessor.java:54)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.getMatching(GroupV2RecordProcessor.java:22)
                                                                                                        at org.thoughtcrime.securesms.storage.DefaultStorageRecordProcessor.process(DefaultStorageRecordProcessor.java:51)
                                                                                                        at org.thoughtcrime.securesms.storage.GroupV2RecordProcessor.process(GroupV2RecordProcessor.java:22)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.processKnownRecords(StorageSyncJob.java:412)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.performSync(StorageSyncJob.java:293)
                                                                                                        at org.thoughtcrime.securesms.jobs.StorageSyncJob.onRun(StorageSyncJob.java:194)
                                                                                                        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)

and also

2024-06-22 16:25:57.387 10745-10809 JobRunner               org.thoughtcrime.securesms           W  [JOB::ee0f5da9-61d2-4b18-b8f5-502bdda3bc2b][LinkedDeviceInactiveCheckJob][4] Failing due to an unexpected exception. (Time Since Submission: 342 ms, Lifespan: 2592000000 ms, Run Attempt: 1/Unlimited, Queue: LinkedDeviceInactiveCheckJob)
                                                                                                    java.util.NoSuchElementException
                                                                                                        at org.thoughtcrime.securesms.jobs.LinkedDeviceInactiveCheckJob.run(LinkedDeviceInactiveCheckJob.kt:2311)
                                                                                                        at org.thoughtcrime.securesms.jobmanager.JobRunner.run(JobRunner.java:86)
                                                                                                        at org.thoughtcrime.securesms.jobmanager.JobRunner.run(JobRunner.java:49)
2024-06-22 16:25:57.430  1381-1503  libprocessgroup         system_server                        W  SetCgroup::ExecuteForProcess: failed to open /dev/cpuctl/foreground-boost/cgroup.procs: No such file or directory
WinSCaP commented 3 months ago

@fgubler thank you for having a fix, it works for me as well.

Have the same issue after linking with a Linux client this morning. Have linked multiple Linux and Windows clients previously without problems.

LukeVader-IV commented 3 months ago

Hi, I had the same issue, running Signal-Foss from the twinhelix F-droid repo. It happened when I tried to link my account to the flatpak desktop application.

Following only the first 4 steps outlined in the original post, I got it working again. (Thanks :D )

PS: you can still create a new backup while you're in flight mode, I reccomend you do that before anything just in case.

Signal-foss 7.8.1

nicholas-signal commented 3 months ago

Hello all,

Can someone experiencing this issue upload a complete debug log? We need the context around the Exception.

Joostb commented 3 months ago

Resolved by updating, see also https://github.com/signalapp/Signal-Android/issues/13600

stale[bot] commented 4 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.