Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

App crashes on each start after pairing with new device

Open fgubler opened this issue 1 year ago • 4 comments

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

  • [x] I have searched open and closed issues for duplicates
  • [x] I am submitting a bug report for existing functionality that does not work as intended
  • [x] I have read https://github.com/signalapp/Signal-Android/wiki/Submitting-useful-bug-reports
  • [x] This isn't a feature request or a discussion topic

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.

  • The first crash came just after scanning the QR-code on the screen of the Ubuntu machine which I newly connected.
  • Subsequent starts of the app would deliver the same results: you would see the chat-list for 1-2s and then the app would crash.

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

  • Restarting the device
  • Uninstalling and re-installing Signal on the same device, connecting to the same account (i.e. same phone-number)
  • Installing Signal on a different Android smartphone (different manufacturer, different OS version) and connecting to the same account. The effect was the same: immediate crashes.

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

  • Flight mode enabled (i.e. no internet connection)
  • Re-installing the app on the same and connecting with a different account.
  • Interestingly, I would still receive notifications about new messages. So Signal running in the background, worked fine.

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

  • Connect a new desktop client on Ubuntu. But I am sure that this does not happen for everyone.

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.

  • Uninstalled and re-installed the app one last time.
  • On first app-start, I selected the backup to be restored.
  • After having entered my phone-number to "log-in", it asked for my PIN again. - That was strange because I had just disabled my PIN, right??? - Well my first reaction was to just enter the old PIN again... Stupid mistake => that lead to the crash happening again. - Therefore I had to uninstall and re-install the app again and start from scratch. => you can avoid that.
    • Do not enter your old PIN here but click skip in the top-right corner.
    • As a consequence, it will tell you that you will now have to authenticate by SMS-code. That is ok => do it.
    • In the next step, it suggests creating a new PIN. I was a bit sick of PINs so skipped that for now.
  • Now the app should start normally with all your chats restored and no crashing 🥳🥳 time to celebrate (and perhaps consume some not strictly speaking healthy beverages of your choosing).
  • Now you can actually go to settings again and set a new PIN (or the old one) and it should still all work.

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

fgubler avatar Jun 24 '24 18:06 fgubler

@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.

WinSCaP avatar Jun 24 '24 20:06 WinSCaP

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

LukeVader-IV avatar Jun 26 '24 10:06 LukeVader-IV

Hello all,

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

nicholas-signal avatar Jun 26 '24 19:06 nicholas-signal

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

Joostb avatar Jul 01 '24 15:07 Joostb

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.

stale[bot] avatar Sep 01 '24 21:09 stale[bot]