Signal Crash on Startup: NullPointerException: Attempt to get length of null array
- [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
Bug description
Signal used to work fine for me, after rebooting my smartphone Signal no longer manages to start but immediately crashes, from logcat (full log at the end of the this report):
java.lang.RuntimeException: Unable to create application org.thoughtcrime.securesms.ApplicationContext: java.lang.NullPointerException: Attempt to get length of null array
04-22 08:37:17.522 15126 15126 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6044)
If you've any idea how I could get Signal up and running again without uninstalling it, I'd be more than grateful. :)
Device info
Device: OnePlus 3T Android version: 9 (OxygenOS 9.0.6) Signal version: 4.58.5
Link to debug log
https://gist.github.com/mika/9384098eecd779b80fd07a14746d04a9
Clearing Signal App's cache didn't help either, FTR
Alright, after running out of ideas and depending on Signal's usage, I had to get out of this rather unfortunate situation and therefore no longer have the data available anymore to reproduce this. :(
JFTR, cleaning Signal storage wasn't enough, had to actually uninstall Signal app and restore from backup.
My error might be the same, although the message is different. I have LineageOS 16.0 (Android version 9), no gapps, device is Samsung Galaxy S5. The problem started when I upgraded to Signal version 4.58.5.
The app crashes immediately upon opening. A few times I saw some info screen (introducing a new feature?) for half a second before it crashed. I also saw the backup process running for a second a few times, and I'm seeing the notification that Signal is supposedly running. Messages that are sent to me are showing as undelivered on other people's phones. Clearing the cache doesn't help.
The trouble is, I only noticed this after a few days. And at some point, the backup process was able to start up, and overwrote my older backups. The ones I have now are just a few KB and are restoring from them doesn't work. I wasn't worrying about the crash because I had just ordered a new phone anyway, but now I found that I can't get my data out. I don't have gapps and adb backup doesn't work. If anybody has an idea on how to get my data out of this phone, I'd be very grateful.
04-25 22:21:26.222 10767 10819 E AndroidRuntime: FATAL EXCEPTION: signal-serial-0
04-25 22:21:26.222 10767 10819 E AndroidRuntime: Process: org.thoughtcrime.securesms, PID: 10767
04-25 22:21:26.222 10767 10819 E AndroidRuntime: org.thoughtcrime.securesms.database.RecipientDatabase$MissingRecipientError: Failed to find recipient with ID: null
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.recipients.LiveRecipientCache.getSelf(LiveRecipientCache.java:95)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.recipients.Recipient.self(Recipient.java:286)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.Megaphones.shouldShowMessageRequestsMegaphone(Megaphones.java:245)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.Megaphones.access$200(Megaphones.java:50)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.Megaphones$1.<init>(Megaphones.java:100)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.Megaphones.buildDisplayOrder(Megaphones.java:95)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.Megaphones.getNextMegaphone(Megaphones.java:64)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.MegaphoneRepository.lambda$getNextMegaphone$2$MegaphoneRepository(MegaphoneRepository.java:68)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at org.thoughtcrime.securesms.megaphone.-$$Lambda$MegaphoneRepository$q9Ph2NWga4K9VBzFhswMpm7EJ5M.run(Unknown Source:4)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
04-25 22:21:26.222 10767 10819 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
Running Signal Beta, I have the same issue. App crashes when i open. Still receive notifications. Have tried rolling back to normal release but can't restore backups. Starting a fresh install without restoring backups would be a major issue for me. Any help on this issue would be greatly appreciated as it's my main chat app. I've submitted bug reports via the app.
Signal 4.59.5, OnePlus 8 Pro, OxygenOS 10.5.4, Android 10 (March)
I have the release signal version, the app also crashes on my phone. There seems to be a problem when initializing the Cipher, the cipher gets a null as a parameter for the key which causes an exception that is not caught, causing the app to crash. I created a pull request which at least catches the exception but something else is going wrong that causes the app to provide the Cipher with a NullPointer as a key.
Signal 4.59.9, Xiaomi Mi A2, Havoc-Os 3.5, Android 10 (May)
Same issue as #9332
Appears I have the same suddenly. I didn't do anything to my phone or signal. Friend messaged me on my laptop via Skype and said to check Signal. Tried to open and crashing immediately. He had messaged me a JPEG, I can see it on the desktop client. Got the error URL.
https://del.dog/pestoocong
time: 1605520174481
msg: java.lang.NullPointerException: Attempt to get length of null array
stacktrace: java.lang.NullPointerException: Attempt to get length of null array
at org.signal.zkgroup.internal.ByteArray.cloneArrayOfLength(ByteArray.java:32)
at org.signal.zkgroup.internal.ByteArray.
same here, release, stopped working on Pixel5 with Android 11
Process: org.thoughtcrime.securesms, PID: 25337
java.lang.NullPointerException: Attempt to get length of null array
at com.google.protobuf.GeneratedMessageLite.parseFrom(GeneratedMessageLite.java:1654)
at org.thoughtcrime.securesms.database.model.databaseprotos.ReactionList.parseFrom(ReactionList.java:649)
at org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper.onUpgrade(SQLCipherOpenHelper.java:1354)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:178)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:233)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:220)
at org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper.getReadableDatabase(SQLCipherOpenHelper.java:1412)
at org.thoughtcrime.securesms.database.RecipientDatabase.getRecipientsWithNotificationChannels(RecipientDatabase.java:694)
at org.thoughtcrime.securesms.notifications.NotificationChannels.ensureCustomChannelConsistency(NotificationChannels.java:483)
at org.thoughtcrime.securesms.notifications.NotificationChannels.lambda$create$0(NotificationChannels.java:87)
at org.thoughtcrime.securesms.notifications.-$$Lambda$NotificationChannels$AnaJfso_skBBDfSgehrfcLZtTb8.run(Unknown Source:2)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
FATAL EXCEPTION: main
Process: org.thoughtcrime.securesms, PID: 25337
java.lang.ExceptionInInitializerError
at org.thoughtcrime.securesms.keyvalue.SignalStore.misc(SignalStore.java:140)
at org.thoughtcrime.securesms.migrations.ApplicationMigrations.onApplicationCreate(ApplicationMigrations.java:96)
at org.thoughtcrime.securesms.ApplicationContext.initializeApplicationMigrations(ApplicationContext.java:243)
at org.thoughtcrime.securesms.ApplicationContext.lambda$gKE1IGqAoyc13fxTm6l3gJlrjAY(Unknown Source:0)
at org.thoughtcrime.securesms.-$$Lambda$ApplicationContext$gKE1IGqAoyc13fxTm6l3gJlrjAY.run(Unknown Source:2)
at org.thoughtcrime.securesms.util.AppStartup.execute(AppStartup.java:142)
at org.thoughtcrime.securesms.ApplicationContext.onCreate(ApplicationContext.java:158)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6715)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NullPointerException: Attempt to get length of null array
at com.google.protobuf.GeneratedMessageLite.parseFrom(GeneratedMessageLite.java:1654)
at org.thoughtcrime.securesms.database.model.databaseprotos.ReactionList.parseFrom(ReactionList.java:649)
at org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper.onUpgrade(SQLCipherOpenHelper.java:1354)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:178)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:233)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:220)
at org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper.getReadableDatabase(SQLCipherOpenHelper.java:1412)
at org.thoughtcrime.securesms.database.DatabaseFactory.hasTable(DatabaseFactory.java:261)
at org.thoughtcrime.securesms.database.KeyValueDatabase.onOpen(KeyValueDatabase.java:91)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:188)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:233)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:220)
at org.thoughtcrime.securesms.database.KeyValueDatabase.getReadableDatabase(KeyValueDatabase.java:181)
at org.thoughtcrime.securesms.database.KeyValueDatabase.getDataSet(KeyValueDatabase.java:100)
at org.thoughtcrime.securesms.keyvalue.KeyValueStore.initializeIfNecessary(KeyValueStore.java:158)
at org.thoughtcrime.securesms.keyvalue.KeyValueStore.getString(KeyValueStore.java:86)
at org.thoughtcrime.securesms.keyvalue.PaymentsValues.currentCurrency(PaymentsValues.java:207)
at org.thoughtcrime.securesms.keyvalue.PaymentsValues.<init>(PaymentsValues.java:65)
at org.thoughtcrime.securesms.keyvalue.SignalStore.<init>(SignalStore.java:56)
at org.thoughtcrime.securesms.keyvalue.SignalStore.<clinit>(SignalStore.java:18)
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.