johanw666 / Signal-Android

Fork from a private messenger for Android with extra options added: full backup and (partial, ony text) xml backup of messages. Restore can happen at any time, not only after a fresh install. Import SMS database. Import of (unencrypted) WhatsApp databases. Removed apk expire. Choose between passphrase protection and the Android screenlock. Choice for the backup location (internal or removable storage on Android < 11 (on 11 and higher this is already possible)). Set the maptype in the place picker. Option to treat view-once media as normal media. Option to ignore remote deletion. Choose between FCM or websocket notification delivery.
https://johanw.home.xs4all.nl/Signal/signal-jw.html
GNU Affero General Public License v3.0
246 stars 16 forks source link

ClassNotFoundException: org.signal.libsignal.net.NetworkException #98

Closed Terrance closed 3 months ago

Terrance commented 3 months ago

As of 7.4.0.0-JW, Signal is repeatedly crashing with the following:

FATAL EXCEPTION: Thread-10
Process: org.thoughtcrime.securesms, PID: 3480
java.lang.ClassNotFoundException: org.signal.libsignal.net.NetworkException
johanw666 commented 3 months ago

I have no idea how that is caused, on my device it works OK. Can you send a debug log? Without it I can't see what happens.

Terrance commented 3 months ago

I use Rethink as a firewall on Android, and it looks like the crashes happen when a network request to cdsi.signal.org fails (perhaps this is a new endpoint added in upstream 7.4.0.0). Having allowed the domain, the app seems to have stopped crashing, but blocking it again doesn't break things -- looks like it was just a one-off (for now) request.

The bit quoted above came from the crash log with no other context. The relevant part of the main log, still unfortunately lacking any kind of stack trace:

[7.4.0.0-JW] [287674] 2024-04-11 15:43:53.146 GMT+01:00 I CdsiV2Service: Starting CDSI lookup via libsignal-net
[7.4.0.0-JW] [287672] 2024-04-11 15:43:53.148 GMT+01:00 I JobRunner: [JOB::d0420fc7-7d6a-4de9-907c-029fad4ef534][RotateCertificateJob][1] Job finished with result SUCCESS in 491 ms. (Time Since Submission: 499 ms, Lifespan: 86400000 ms, Run Attempt: 1/Unlimited, Queue: __ROTATE_SENDER_CERTIFICATE__)
[7.4.0.0-JW] [287698] 2024-04-11 15:43:56.580 GMT+01:00 I libsignal: rust/net/src/infra/connection_manager.rs:193: Connection attempt failed with an error: transport: Failed to establish TCP connection to any of the IPs
[7.4.0.0-JW] [287690] 2024-04-11 15:44:00.922 GMT+01:00 I WebSocketConnection: [normal:33720672] Sending keep alive...
[7.4.0.0-JW] [287690] 2024-04-11 15:44:00.926 GMT+01:00 I WebSocketConnection: [unidentified:167615400] Sending keep alive...
[7.4.0.0-JW] [287690] 2024-04-11 15:44:00.935 GMT+01:00 D AlarmSleepTimer: Setting an exact alarm to wake up in 19995ms.
[7.4.0.0-JW] [287699] 2024-04-11 15:44:01.611 GMT+01:00 I libsignal: rust/net/src/infra/connection_manager.rs:193: Connection attempt failed with an error: transport: Failed to establish TCP connection to any of the IPs
[7.4.0.0-JW] [287700] 2024-04-11 15:44:01.656 GMT+01:00 I libsignal: rust/net/src/infra/connection_manager.rs:193: Connection attempt failed with an error: transport: Failed to establish TCP connection to any of the IPs
[7.4.0.0-JW] [287701] 2024-04-11 15:44:03.161 GMT+01:00 E SignalUncaughtException: 
[7.4.0.0-JW] [287701] 2024-04-11 15:44:03.161 GMT+01:00 E SignalUncaughtException: java.lang.ClassNotFoundException: org.signal.libsignal.net.NetworkException
[7.4.0.0-JW] [287701] 2024-04-11 15:44:03.161 GMT+01:00 E SignalUncaughtException: 
[7.4.0.0-JW] [287701] 2024-04-11 15:44:03.231 GMT+01:00 I JobManager: Successfully flushed.

📎 log.txt

johanw666 commented 3 months ago

OK that seems to be not Signal's fault.

Terrance commented 3 months ago

I'd argue it's a sign of something bigger if missing classes are being referenced (indeed I can't see a top-level NetworkException in the repo, is there a new module or something absent from the build?), and I wouldn't be surprised if a similar crash came about because of actual connection disruption, but the immediate problem has gone away for now.

johanw666 commented 3 months ago

Yes, and at least the app should not crash. However, this seems a Signal issue not specifically tied to this fork. One of us could open an issue in the Signal repo because they will have to fix this.

johanw666 commented 3 months ago

I think https://github.com/signalapp/Signal-Android/commit/b3336b4d84def3c167b5fd115d1b5395cb06c65f might have fixed this.

Terrance commented 3 months ago

Yep, picked up the update here yesterday and connection failures seem to be handled properly now (looks like that request goes out once a day, so I had to wait a bit for it to trigger again).