signalapp / Signal-Android

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

Restore from backup fails with "Incorrect backup passphrase" #12743

Open jeromio opened 1 year ago

jeromio commented 1 year ago

Bug description

Attempts to restore chat backup fail with "Incorrect Passphrase" error yet correct (verified) passphrase was used. This has now happened to me 3 times over the span of 2 years. Same reproduction steps each time. I have never been able to restore a backup 🙁.

Steps to reproduce

Actual result: No restore happens: all saved messages lost forever Expected result: Successfully restored all messages contained in the backup

Screenshots

Device info

Device: Google Pixel 3, Samsung Flip3, Samsung Flip4 Android versions: 11,12,12.1 Signal version: 6.8.3

Link to debug log

Not possible to get debug log from restore process since it can only be accessed before the actual app is launched for the 1st time.

cody-signal commented 1 year ago

Hi there, sorry you are encountering this. You can get a debuglog in the restore flow by tapping on the title of the screen 8 times.

When entering the passphrase are you typing it manually or pasting it?

AJolly commented 1 year ago

@cody-signal Is that debuglog saved anywhere if Signal crashes? I've got a backup that's failing to import for me. I made it before resetting my phone, the password is correct, but import fails/crashes signal about 5200 messages in. Trying to find whatever logs I can so I can file a bug report.

cody-signal commented 1 year ago

Yes, the logs are persisted through a crash. So you can do the same and tap on the title of the screen eight times after starting the app after the crash.

gotgot1995 commented 1 year ago

Thank goodness, I'm not the only one going through the same issue. :pray:

I proceeded exactly as @jeromio did and got the same result. For the record, I have entered the passphrase manually, not copied/pasted (try a bunch of times desperately too with no luck).

cody-signal commented 1 year ago

@gotgot1995 Can you tap on the title of any of the registration screens eight times after starting the app to get debuglogs and submit that here?

gotgot1995 commented 1 year ago

But of course @cody-signal. Here you go.

signal-log-1682021126912.zip

stale[bot] commented 1 year 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.

stale[bot] commented 1 year ago

This issue has been closed due to inactivity.

le-dawg commented 9 months ago

Exactly the same happens to me when transferring from OnePlus 6 to OnePlus Nord 2. Both phones not rooted. The import step doesn't even start. I entered the passphrase both possible ways: reading it either row by row and left to right or column by column and left to right.

Neither works.

This is , eh , ridiculous. This is not a cryptography problem i think.

le-dawg commented 9 months ago

FWIW: I am trying to import a backup from version 6.30.4 into version 6.6.3

le-dawg commented 9 months ago

FYI:

I was able to resolve this issue by:

It appears that there was a backward compatibility issue.

imyxh commented 7 months ago

I have the same issue, and I too have verified in-app that the passphrase is correct.

I'm now in this weird limbo where I don't want to set up Signal again, because then I won't be able to import my old messages later, but I still need to use Signal to talk to my contacts.

Nothing in the log seems particularly relevant but here it is anyway: signal-log-1700633612372.zip

Could we get this issue re-opened and unmarked as wontfix?

studiok87 commented 6 months ago

Same problem here, updated the firmware of Asus Zenfone with a factory reset and can't open my last 3 backups (which are all I have). When I switch to home after "Incorrect passphrase" popup, open Signal again and skip restore, enter my phone number etc and then try verifying the backup code in Settings -> Chat -> Backup, it verifies correctly. It's the same passphrase I used for such a long time and that worked every 6 moths or so when I reset to factory and update the phone.

Signal Version 6.41.3, Android 13

Might there be any problems that Signal Desktop is still installed on a Linux Mint partition (not booted from that since I have the restoring problem)? Signal Debug log says "Linked Devices: false"

kocherjj commented 5 months ago

I have this same issue. My phone service provider told me I had to factory reset my phone as a troubleshooting step when we could not resolve a calling issue. I backed up Signal, verified the passphrase, factory reset my phone, and now it rejects the passphrase, which I saved to my password manager before verifying so I know it is is exact. I have tried both manually typing it in and copy/pasting. In both cases I get the 'Incorrect Passphrase' message. Does this mean 5 years of message history is gone forever?

greyson-signal commented 5 months ago

@imyxh

I have the same issue, and I too have verified in-app that the passphrase is correct.

Really strange, we supposedly log the exception we hit, but it's not in your normal logs. I see this in your logcat at the same time:

11-22 01:12:47.396  5866  5936 W KeyStore: android.os.ServiceSpecificException:  (code 7)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.Parcel.createException(Parcel.java:2357)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.Parcel.readException(Parcel.java:2340)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.Parcel.readException(Parcel.java:2282)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.security.keystore.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:988)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.security.KeyStore.get(KeyStore.java:233)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.security.KeyStore.get(KeyStore.java:222)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:165)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.security.KeyStoreSpi.engineEntryInstanceOf(KeyStoreSpi.java:583)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.security.KeyStore.entryInstanceOf(KeyStore.java:1631)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.crypto.KeyStoreHelper.hasKeyStoreEntry(KeyStoreHelper.java:147)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.crypto.KeyStoreHelper.getOrCreateKeyStoreEntry(KeyStoreHelper.java:82)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.crypto.KeyStoreHelper.seal(KeyStoreHelper.java:51)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.backup.BackupPassphrase.set(BackupPassphrase.java:47)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.registration.fragments.RestoreBackupFragment$2.doInBackground(RestoreBackupFragment.java:290)
11-22 01:12:47.396  5866  5936 W KeyStore:  at org.thoughtcrime.securesms.registration.fragments.RestoreBackupFragment$2.doInBackground(RestoreBackupFragment.java:281)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.AsyncTask$3.call(AsyncTask.java:394)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11-22 01:12:47.396  5866  5936 W KeyStore:  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-22 01:12:47.396  5866  5936 W KeyStore:  at java.lang.Thread.run(Thread.java:923)

But this is made by the system, not us, and reports online indicate this particular error is usually something that the KeyStore will log but not throw. I can't tell just by looking at the logs. If this is the issue, there's not much we do besides provide a better error message. We need the KeyStore for many app operations.

Regardless, ya'll are likely hitting some error that is not an incorrect passphrase and we're just rendering a bad error message, but there is some other problem with the backup here that we'll need to find out, but that can only be debugged with logs.

@kocherjj @studiok87 Please share logs.

studiok87 commented 3 months ago

Sorry for answering that late, too busy the last months, but I'll send you debug and logcat via mail. Or anything else I can provide (non-rooted phone)? Seems like many more users have this problem -> #13333 Is #6159 solved or still everything in logcat?

Update: @greyson-signal : I reproduced the failure with one of the old backups on my second phone, sent you the android bug report via mail. Can't create Signal debug because Verification Code is not sent, so I'm stuck at this screen. Idk what the heck is the problem now..

giammin commented 3 months ago

having the same problem... this issue is not resolved and should be reopened

pabloscloud commented 2 months ago

I have the same issue. I lost my backup for the thousand time now. Remove file backups if it won't work...

DDPF02 commented 1 month ago

I have the same issue....

signal-log-1717428673731.zip

studiok87 commented 1 month ago

Dear Signal-devs, two months ago I've sent you logs twice and all I got was two e-mails with this: "Hi there, I’d like to help you. Did you see our previous email? Did you start using Signal?" Is that a joke? If it's a serious question, my answer is: yes, I started using Signal since it was published and I regret it!

PeteSapai commented 1 week ago

This seems to have happened to me as well. I have a screenshot from 2021-06-06 with the passphrase, I'm 99% certain it should still be the same one (I have no idea why it wouldn't be). I reinstalled the OS yesterday, installed Signal just now and tried to restore the backup; I'm 100% certain I entered the correct 30 numbers, but I get "incorrect backup passphrase" thrice.

Edit: I found a backup from 2021-08-11 which does accept the passphrase. I do not recall ever re-installing Signal. Would that even change the passphrase? Is it possible an update changed it?

Edit2: fuck it, I'll just start over from scratch. I'll have absolutely 0 chat history, but at least every 0 of those chats will be secure! So secure, I'm not even able to have them! This, the complete lack of syncing messages with the desktop app and constantly losing chat history there too, and the devs failure to e.g. implement something simple as getting Signal desktop to follow the system 24h time format and their refusal (after 4+ years I think we can call it 'refusal') to fix it or implement an option to set the time format is why I will not recommend Signal anymore. I will acknowledge that if you want security, Signal is the way to go, and the people who prefer security over usability will find Signal anyway, but I much prefer a slightly less secure chat history over a 100% secure nothing.