signalapp / Signal-Android

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

Unable to restore encrypted backup - Bad MAC #8355

Closed mike-edel closed 2 years ago

mike-edel commented 5 years ago

Bug description

Unable to restore signal backup on new phone. Similar to #7637 but I don't have xposed installed. Signal stable closing without error after reading 11401 messages. Signal beta giving error message about incorrect passphrase after reading 11401 messages. I am certain the passphrase and the backup are correct as they are working fine using https://github.com/xeals/signal-back

Steps to reproduce

Actual result:

Expected result: Backup is successfully restored.

Screenshots

beta error (in German due to phone language) _20181110_121218

Device info

Device: Nokia 7 Plus Dual-Sim Android version: 9 Kernel version: 4.4.146-perf+ Signal version: Beta: 4.30.2 also tested on stable: 4.29.7

Link to debug log

Working on grabbing a logcat log but struggling with it. Will add through edit. Logcat for version 4.29.7:

--------- beginning of crash
11-08 22:32:10.330  4472  6987 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
11-08 22:32:10.330  4472  6987 E AndroidRuntime: Process: org.thoughtcrime.securesms, PID: 4472
11-08 22:32:10.330  4472  6987 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at android.os.AsyncTask$3.done(AsyncTask.java:354)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:271)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:764)
11-08 22:32:10.330  4472  6987 E AndroidRuntime: Caused by: java.lang.NegativeArraySizeException: -1884239691
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at org.thoughtcrime.securesms.backup.FullBackupImporter$BackupRecordInputStream.readFrame(FullBackupImporter.java:310)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at org.thoughtcrime.securesms.backup.FullBackupImporter$BackupRecordInputStream.readFrame(FullBackupImporter.java:252)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at org.thoughtcrime.securesms.backup.FullBackupImporter.importFile(FullBackupImporter.java:81)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:394)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:386)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at android.os.AsyncTask$2.call(AsyncTask.java:333)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11-08 22:32:10.330  4472  6987 E AndroidRuntime:    ... 4 more

logcat for version 4.30.2:

11-10 13:15:20.687 27588 31822 W RegistrationActivity: null
11-10 13:15:20.687 27588 31822 W RegistrationActivity: java.io.IOException: Bad MAC
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at org.thoughtcrime.securesms.backup.FullBackupImporter$BackupRecordInputStream.readAttachmentTo(FullBackupImporter.java:298)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at org.thoughtcrime.securesms.backup.FullBackupImporter.processAttachment(FullBackupImporter.java:140)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at org.thoughtcrime.securesms.backup.FullBackupImporter.importFile(FullBackupImporter.java:87)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:396)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:388)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at android.os.AsyncTask$2.call(AsyncTask.java:333)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
11-10 13:15:20.687 27588 31822 W RegistrationActivity:  at java.lang.Thread.run(Thread.java:764)
bepaald commented 5 years ago

@mk121212 I think this was 99.9% certainly a case of wrong password, any chance of that? Otherwise, if corruption did occur in the very first bytes of the backup, your data could never have been saved anyway.

mk121212 commented 5 years ago

@bepaald That's what I thought several times. However, I am sure that it was the correct password. I did not only write the password down but also took a picture of Signal showing it on the old phone. So I was able to check carefully.

With the old password I made backups several times a day for a couple of days. Sometimes I deleted the former backup on the old phone, sometimes I didn't. This way I was sure that the new file was written a new memory address and (to some extend) that the corruptions does not come from the hardware. The result was always like described in my post above. After disabling and re-enabling backups, the first backup with the new password worked perfectly fine (on the new phone and with the tools).

Still, I don't know whether this helps with the bad MAC problematic described in this issue but maybe it does point to other code parts of Signals backup functionality that could help solving this issue.

SelfSealShelf commented 5 years ago

Is this safe to do? It seems like bad practice to decrypt your backup outside of signal. If the backup contains key material that would expose it.

bepaald commented 5 years ago

@AbstractThought I'm not sure what you mean. In normal operation, all (unencrypted) data only lives in memory, but I suppose you could imagine some malware exists that gets to it, but I'd say it's far more likely that type of malware exists for android and is looking for the signal app, than for PC looking for my program. Personally, I actually trust my PC more than I do my phone.

@santa-klaus I have some initial backup merging support. It works on the small files I tried, but definitely needs testing. Are you interested in trying? The method is a little involved as it actually turned out to be quite a difficult procedure.

Example, click to open if you dare... ;)

Assuming a current backup `current.backup` and an old one `source.backup`. First you need to get a list of threads from the old backup: ``` [~/programming/signalbackup-tools] $ ./signalbackup-tools --listthreads source.backup 871668681636341580140408145422 IV: (hex:) e3 1c c6 5c 46 e3 b6 62 ff a7 95 40 e6 99 f9 eb (size: 16) SALT: (hex:) 35 6a 55 bc 80 e9 da dd 2c ed 28 e2 da 22 f4 b8 3b e3 5d 44 2b 94 18 3e d0 6a 6f e3 79 d9 5d 1f (size: 32) BACKUPKEY: (hex:) 3e 91 7a 80 66 9f 6b 1f a9 77 b1 3e fb 10 ae 15 b2 b4 69 7f 99 ad 40 16 57 61 00 ce cc 8e d0 cc (size: 32) CIPHERKEY: (hex:) 69 67 67 1b d7 51 41 84 33 88 6b 1e 3b 21 e9 96 6e f7 f0 0d 61 ec 64 6e 44 29 97 3e df 49 83 26 (size: 32) MACKEY: (hex:) 0b 30 c9 d3 56 6b 8c 81 f3 f5 bb cf 1d b4 ed 57 66 dc c8 72 11 58 04 42 07 db b8 a1 61 62 2e c3 (size: 32) COUNTER: 3810313820 Reading backup file... FRAME 93 (100.0%)... Read entire backup file... done! ---------------------------------------------------------------------------------------------------------- | _id | recipient_ids | snippet | COALESCE(recipient_prefer[...] | ---------------------------------------------------------------------------------------------------------- | 1 | +161765XXXXX | <#> Your Signal verificat[...] | (NULL) | | 2 | __textsecure_group__!a2c3[...] | Ok | devgroup | | 3 | +316474XXXXX | Last msg | Master Phone | | 4 | +316836XXXXX | Ok | Devphone Red | ---------------------------------------------------------------------------------------------------------- ``` Then, you can import a selection of threads from the source file into your current backup and export to a new backup file. Expect tons of output (I really need to clean that up sometime): ``` [~/programming/signalbackup-tools] $ ./signalbackup-tools --importthreads 2,3,4 --source source.backup --sourcepassword 871668681636341580140408145422 --output merged.backup --opassword 000000000000000000000000000000 current.backup 420676745407910020904427069666 IV: (hex:) e2 dd c7 b0 d7 c1 81 01 6b db f8 24 47 98 5c 35 (size: 16) SALT: (hex:) 47 a8 83 be 1f 9f d7 a4 db 6c 82 bd c4 d2 e9 4b 5e 90 d7 fd a4 98 81 4a 62 f1 0e d6 e5 52 f7 ee (size: 32) BACKUPKEY: (hex:) b1 59 c2 ec ce cf dc de 37 6f bd af 15 79 06 c7 30 c4 56 3f 5f 60 f8 74 67 34 90 7b a5 c5 44 2b (size: 32) CIPHERKEY: (hex:) 69 12 52 65 c2 5d 96 e0 26 dc 46 6c 95 92 18 f0 e7 69 31 7d 07 f7 ce 7e 4d 74 76 10 d1 78 da d8 (size: 32) MACKEY: (hex:) 37 4c bc 18 c2 93 47 60 67 63 0d 81 24 65 9e ab 55 a3 c6 17 fb 95 26 2e 4a 68 e8 aa 5c a5 0b 7e (size: 32) COUNTER: 3806185392 Reading backup file... FRAME 88 (100.0%)... Read entire backup file... done! Importing thread 2 from source file: source.backup IV: (hex:) e3 1c c6 5c 46 e3 b6 62 ff a7 95 40 e6 99 f9 eb (size: 16) SALT: (hex:) 35 6a 55 bc 80 e9 da dd 2c ed 28 e2 da 22 f4 b8 3b e3 5d 44 2b 94 18 3e d0 6a 6f e3 79 d9 5d 1f (size: 32) BACKUPKEY: (hex:) 3e 91 7a 80 66 9f 6b 1f a9 77 b1 3e fb 10 ae 15 b2 b4 69 7f 99 ad 40 16 57 61 00 ce cc 8e d0 cc (size: 32) CIPHERKEY: (hex:) 69 67 67 1b d7 51 41 84 33 88 6b 1e 3b 21 e9 96 6e f7 f0 0d 61 ec 64 6e 44 29 97 3e df 49 83 26 (size: 32) MACKEY: (hex:) 0b 30 c9 d3 56 6b 8c 81 f3 f5 bb cf 1d b4 ed 57 66 dc c8 72 11 58 04 42 07 db b8 a1 61 62 2e c3 (size: 32) COUNTER: 3810313820 Reading backup file... FRAME 93 (100.0%)... Read entire backup file... done! Deleting messages not belonging to requested thread(s) from 'sms' Deleting messages not belonging to requested thread(s) from 'mms' Deleting attachment entries from 'part' not belonging to remaining mms entries Deleting other threads from 'thread'... Dealing with thread id: 2 Updating msgcount Setting last msg date Updating snippet Updating snippet type Deleting removed groups... Delete others from 'identities' Deleting group receipts entries from deleted messages... Deleting drafts from deleted threads... Adjusting indexes in tables... Compacting table: sms Compacting table: mms Compacting table: part Compacting table: recipient_preferences Compacting table: groups Compacting table: identities Compacting table: group_receipts Compacting table: drafts Found existing thread for this recipient in target database, merging into thread 5 Importing statements from source table 'sms'...4 entries... Importing statements from source table 'mms'...3 entries... Importing statements from source table 'part'...0 entries... Importing statements from source table 'drafts'...0 entries... Importing statements from source table 'push'...0 entries... Importing statements from source table 'group_receipts'...6 entries... Importing statements from source table 'sticker'...0 entries... Importing statements from source table 'job_spec'...0 entries... Importing statements from source table 'constraint_spec'...0 entries... Importing statements from source table 'dependency_spec'...0 entries... Importing thread 3 from source file: source.backup IV: (hex:) e3 1c c6 5c 46 e3 b6 62 ff a7 95 40 e6 99 f9 eb (size: 16) SALT: (hex:) 35 6a 55 bc 80 e9 da dd 2c ed 28 e2 da 22 f4 b8 3b e3 5d 44 2b 94 18 3e d0 6a 6f e3 79 d9 5d 1f (size: 32) BACKUPKEY: (hex:) 3e 91 7a 80 66 9f 6b 1f a9 77 b1 3e fb 10 ae 15 b2 b4 69 7f 99 ad 40 16 57 61 00 ce cc 8e d0 cc (size: 32) CIPHERKEY: (hex:) 69 67 67 1b d7 51 41 84 33 88 6b 1e 3b 21 e9 96 6e f7 f0 0d 61 ec 64 6e 44 29 97 3e df 49 83 26 (size: 32) MACKEY: (hex:) 0b 30 c9 d3 56 6b 8c 81 f3 f5 bb cf 1d b4 ed 57 66 dc c8 72 11 58 04 42 07 db b8 a1 61 62 2e c3 (size: 32) COUNTER: 3810313820 Reading backup file... FRAME 93 (100.0%)... Read entire backup file... done! Deleting messages not belonging to requested thread(s) from 'sms' Deleting messages not belonging to requested thread(s) from 'mms' Deleting attachment entries from 'part' not belonging to remaining mms entries Deleting other threads from 'thread'... Dealing with thread id: 3 Updating msgcount Setting last msg date Updating snippet Updating snippet type Deleting removed groups... Delete others from 'identities' Deleting group receipts entries from deleted messages... Deleting drafts from deleted threads... Adjusting indexes in tables... Compacting table: sms Compacting table: mms Compacting table: part Compacting table: recipient_preferences Compacting table: groups Compacting table: identities Compacting table: group_receipts Compacting table: drafts Found existing thread for this recipient in target database, merging into thread 6 Importing statements from source table 'sms'...5 entries... Importing statements from source table 'mms'...1 entries... Importing statements from source table 'part'...1 entries... Importing statements from source table 'drafts'...0 entries... Importing statements from source table 'push'...0 entries... Importing statements from source table 'group_receipts'...0 entries... Importing statements from source table 'sticker'...0 entries... Importing statements from source table 'job_spec'...0 entries... Importing statements from source table 'constraint_spec'...0 entries... Importing statements from source table 'dependency_spec'...0 entries... Importing thread 4 from source file: source.backup IV: (hex:) e3 1c c6 5c 46 e3 b6 62 ff a7 95 40 e6 99 f9 eb (size: 16) SALT: (hex:) 35 6a 55 bc 80 e9 da dd 2c ed 28 e2 da 22 f4 b8 3b e3 5d 44 2b 94 18 3e d0 6a 6f e3 79 d9 5d 1f (size: 32) BACKUPKEY: (hex:) 3e 91 7a 80 66 9f 6b 1f a9 77 b1 3e fb 10 ae 15 b2 b4 69 7f 99 ad 40 16 57 61 00 ce cc 8e d0 cc (size: 32) CIPHERKEY: (hex:) 69 67 67 1b d7 51 41 84 33 88 6b 1e 3b 21 e9 96 6e f7 f0 0d 61 ec 64 6e 44 29 97 3e df 49 83 26 (size: 32) MACKEY: (hex:) 0b 30 c9 d3 56 6b 8c 81 f3 f5 bb cf 1d b4 ed 57 66 dc c8 72 11 58 04 42 07 db b8 a1 61 62 2e c3 (size: 32) COUNTER: 3810313820 Reading backup file... FRAME 93 (100.0%)... Read entire backup file... done! Deleting messages not belonging to requested thread(s) from 'sms' Deleting messages not belonging to requested thread(s) from 'mms' Deleting attachment entries from 'part' not belonging to remaining mms entries Deleting other threads from 'thread'... Dealing with thread id: 4 Updating msgcount Setting last msg date Updating snippet Updating snippet type Deleting removed groups... Delete others from 'identities' Deleting group receipts entries from deleted messages... Deleting drafts from deleted threads... Adjusting indexes in tables... Compacting table: sms Compacting table: mms Compacting table: part Compacting table: recipient_preferences Compacting table: groups Compacting table: identities Compacting table: group_receipts Compacting table: drafts Importing statements from source table 'sms'...4 entries... Importing statements from source table 'mms'...0 entries... Importing statements from source table 'part'...0 entries... Importing statements from source table 'thread'...1 entries... Importing statements from source table 'identities'...0 entries... Importing statements from source table 'drafts'...0 entries... Importing statements from source table 'push'...0 entries... Importing statements from source table 'groups'...0 entries... Importing statements from source table 'recipient_preferences'...0 entries... Importing statements from source table 'group_receipts'...0 entries... Importing statements from source table 'sticker'...0 entries... Importing statements from source table 'job_spec'...0 entries... Importing statements from source table 'constraint_spec'...0 entries... Importing statements from source table 'dependency_spec'...0 entries... Exporting backup to 'merged.backup' Writing HeaderFrame... Writing DatabaseVersionFrame... Writing SqlStatementFrame(s)... Dealing with table 'sms'... 25/25 entries...done Dealing with table 'mms'... 7/7 entries...done Dealing with table 'part'... 2/2 entries...done Dealing with table 'thread'... 7/7 entries...done Dealing with table 'identities'... 3/3 entries...done Dealing with table 'drafts'... 0/0 entries... Dealing with table 'push'... 0/0 entries... Dealing with table 'groups'... 1/1 entries...done Dealing with table 'recipient_preferences'... 4/4 entries...done Dealing with table 'group_receipts'... 8/8 entries...done Dealing with table 'sticker'... 0/0 entries... Dealing with table 'job_spec'... 1/1 entries...done Dealing with table 'constraint_spec'... 0/0 entries... Dealing with table 'dependency_spec'... 0/0 entries... Writing SharedPrefFrame(s)... Writing EndFrame... Done! ``` The program automatically tries to determine into which thread of the current db the old messages should be inserted. This might fail if contact have changed numbers or if one of the backups has a contact with a country code (+316.....) and the other omits it (06....).

oneof3holes commented 5 years ago

@bepaald been fighting with coinbase to release my dust without me sending in a pic of my ID. Finally happened, didn't want you to think I forgot about you. Thank you again.

bepaald commented 5 years ago

@oneof3holes O wow, thanks! I thought you had just decided against it (which would have been fine of course), but this is cool. I really appreciate it. Thanks again!

santa-klaus commented 5 years ago

@bepaald I am sorry, I got drowned in work. I might have some more time to try things in October and would like to do it. Also, my phone broke, so I will probably have a good reason to merge backups soon. I'll let you know when I get around to do some testing.

bepaald commented 4 years ago

@santa-klaus Absolutely not a problem of course. However, just a heads up: I was looking at the source of the 4.48 beta that is currently out and it will change the internal sql database in such a way that it will certainly break my current merging code.

I do plan to rewrite the code to be able to merge backups, but there is no telling how long it will take me. Also, it might take even longer (if ever) to get to a point where I can merge an old style db into a new one which would probably also be a use case after your current install updates to 4.48.

Obviously, you don't have to do it if you don't want to or don't have time, but I just wanted to warn you that the window of opportunity might be closing.

santa-klaus commented 4 years ago

Oh, that is really good to know, thank you for the heads up! To be honest, for me it doesn't sound like rewriting stuff to be able to merge old and new backups is worth the effort, since this will have some, but very limited use cases...

I'll definitely write if I manage to look into this!

Am 25.09.2019 20:39 schrieb bepaald:

@santa-klaus [1] Absolutely not a problem of course. However, just a heads up: I was looking at the source of the 4.48 beta that is currently out and it will change the internal sql database in such a way that it will certainly break my current merging code.

I do plan to rewrite the code to be able to merge backups, but there is no telling how long it will take me. Also, it might take even longer (if ever) to get to a point where I can merge an old style db into a new one which would probably also be a use case after your current install updates to 4.48.

Obviously, you don't have to do it if you don't want to or don't have time, but I just wanted to warn you that the window of opportunity might be closing.

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

Links:

[1] https://github.com/santa-klaus [2] https://github.com/signalapp/Signal-Android/issues/8355?email_source=notifications&amp;email_token=ACTFAB5LXJRUNB2334ODHLLQLOV4TA5CNFSM4GC73FNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7S5I7Q#issuecomment-535155838 [3] https://github.com/notifications/unsubscribe-auth/ACTFAB3ATVCOA66YK2JLMNTQLOV4TANCNFSM4GC73FNA

alpha1 commented 4 years ago

Same issue, android 10. Adding my info and a screen cast in case it helps any.

Actual result: I have followed Signal's instructions on backing up and restoring a backup. I am moving from a OnePlus 5t to a OnePlus 7t, both using Signal beta, latest. When I type in the wrong backup code, it fails to restore the backup, which is expected, but when I type in the right code, it proceeds to loop through all messages and then throw a toast error saying "Incorrect backup passphrase", and does not import the backup.

Expected result: Backup would restore messages

Screenshots

Screencast: https://imgur.com/a/TirPqVa

Device info

Device: OnePlus 7t (HD1905) Android version: 10 Signal version: 4.49.7 (beta)

Link to debug log

https://debuglogs.org/3bb67a2279313eb2d71a190b82d949b32684407fb8371d9bdae64cf00b06ea52

alpha1 commented 4 years ago

I'll add to this, I had almost 70,000 messages, and when I trimmed conversations to 15,000 messages, I removed around 20,000 total messages, and then the import worked. So it's something with the contents of the message themselves, perhaps that attachment issue mentioned above.

dcormier commented 4 years ago

I am having the same issue. I have some 19K+ messages in a backup file that's about 2GB. I've made very sure the passphrase is correct. These were my steps:

  1. On the source phone, started from scratch by:
    1. Turning off backups
    2. Ensuring they were all deleted
    3. Turning backups back on
    4. Tapped on the passphrase to copy it
    5. Pasted it into my password manager
    6. Creating a new backup
  2. Moved the backup file to the new phone
  3. Copied the passphrase from my password manager to Signal on the new phone to restore the backup.

Signal almost immediately stops and pops up a toast that says "Incorrect backup passphrase".

Using signal-back's check option with the passphrase says "Backup looks okay from here."

rba7sp commented 4 years ago

I have the same issue. :(

10-27 18:12:51.188 11228 12084 W RegistrationActivity: null 10-27 18:12:51.188 11228 12084 W RegistrationActivity: java.io.IOException: Bad MAC 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at org.thoughtcrime.securesms.backup.FullBackupImporter$BackupRecordInputStream.readAttachmentTo(FullBackupImporter.java:289) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at org.thoughtcrime.securesms.backup.FullBackupImporter.processAttachment(FullBackupImporter.java:134) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at org.thoughtcrime.securesms.backup.FullBackupImporter.importFile(FullBackupImporter.java:81) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:383) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at org.thoughtcrime.securesms.RegistrationActivity$2.doInBackground(RegistrationActivity.java:376) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at android.os.AsyncTask$2.call(AsyncTask.java:333) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at java.util.concurrent.FutureTask.run(FutureTask.java:266) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 10-27 18:12:51.188 11228 12084 W RegistrationActivity: at java.lang.Thread.run(Thread.java:764)

alan-signal commented 4 years ago

@dcormier Make sure all 30 digits are there. When pasting a passphrase containing spaces, the last 5 digits can be left off.

Either copy the digits without spaces, or manually add those last 5.

dcormier commented 4 years ago

Make sure all 30 digits are there. When pasting a passphrase containing spaces, the last 5 digits can be left off.

Either copy the digits without spaces, or manually add those last 5.

I'll try that later, but perhaps the app should handle that differently? Seems like a UX problem. Maybe the app should accept the pasted value and remove the whitespace internally? Or try it both ways (with the pasted whitespace included and then with it removed)?

alan-signal commented 4 years ago

For those of you who are in a situation where you still have your old (broken) backup and would like to try to restore it, I've has made an experimental branch that has been able to restore these broken backups (or at least what we think they look like).

You can reach out to me at alan@signal.org. I can get you a release-signed build of this branch and we can see if that fixes the problem.

Alternatively, if you’re competent at Android development, the source for the fix is at: https://github.com/signalapp/Signal-Android/tree/alan/backup-restoration where the procedure would be to restore the bad backup using that branch, make a new backup, then get back on official releases and restore once more with the new backup.

A debug log from successful or failed attempts to restore the bad backup (either using that branch or an officially signed build of it from Greyson) would be very useful.

travisterrell commented 3 years ago

I see this is still open, but no new comments in a year or so, so hoping to find out about the current status. I'm experiencing the same problem, and my online searching has yielded some other users with the issue, but no solution. Passphrase definitely entered correctly (as mentioned elsewhere, the behavior is different than when entered incorrectly--the counter increases as it loops through the old messages until eventually stopping with the invalid passphrase error.)

@alan-signal It looks like the branch you had created for users to workaround this problem is now gone (though at a year old, I'm not positive it would've imported messages from a newer version of Signal?) I'm a developer (though not Android), so I shouldn't be completely useless at figuring things out if there were a version I could make work. FWIW, there are definitely loads of attachments of many different file types--which I'm willing to lose if that's what it were to take. Also, here's a link to logcat output, though I don't see anything relevant myself.

I'm really hoping to get this resolved, as the backup contains almost 20k messages that I actually need to reference somewhat often. Worst case scenario, I suppose I can leave Signal with its backed up messages on my old device to reference when needed, but that really seems non-ideal. Anyway,

spospartan104 commented 3 years ago

@travisterrell I had this problem before; my issue was much like someone said above and their was a borked multimedia file in an old message (signal message not a carrier mms, but carrier could be a similar issue)

I can't get on to my main system today (moving) But I may be able to dig up the application that was mentioned here as those links have expired. https://github.com/signalapp/Signal-Android/issues/8355#issuecomment-468377021

Alternatively you can use the media view in a few different of your larger conversations to see if there are any broken files (could just be blacked out images as thumbnails)

bepaald commented 3 years ago

@spospartan104 (and @travisterrell): the program is here: https://github.com/bepaald/signalbackup-tools

I do believe however that the app is a lot more tolerant of bad attachments in the backup these days, so if it fails to import the backup file, the damage to the file might be bigger than you would hope.

My program should still be able to get all information that is in the backup out of it and into a new, working backup, but it is by no means guaranteed to be an automated process anymore, it often requires some custom coding. Let me know if I can help. And please forgive any slow response from me, I have some busy work periods sometimes, especially this time of year.

travisterrell commented 3 years ago

Thank you very much! I didn't get an opportunity to start manually scanning through my attachments yesterday, so I'll give the tool a try in a bit and see what happens. My c++ knowledge has probably gotten a bit rusty since I last had to write in it a decade ago, so hopefully it'll work without too much custom coding.

It makes sense that Signal itself has gotten better at backups, given I found less reports of this issue in recent times than a year ago when searching before.

Update: Success with the command line tool! Also, this is pretty cool; I'm going to play around with it some more, like the export tool. Thanks!

On Thu, Dec 3, 2020, 10:19 AM bepaald notifications@github.com wrote:

@spospartan104 https://github.com/spospartan104 (and @travisterrell https://github.com/travisterrell): the program is here: https://github.com/bepaald/signalbackup-tools

I do believe however that the app is a lot more tolerant of bad attachments in the backup these days, so if it fails to import the backup file, the damage to the file might be bigger than you would hope.

My program should still be able to get all information that is in the backup out of it and into a new, working backup, but it is by no means guaranteed to be an automated process anymore, it often requires some custom coding. Let me know if I can help. And please forgive any slow response from me, I have some busy work periods sometimes, especially this time of year.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-Android/issues/8355#issuecomment-738113769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMUG5WF6KTTIE54XIP2YZ3SS63ARANCNFSM4GC73FNA .

spospartan104 commented 3 years ago

@bepaald With the save again; :)

stale[bot] commented 2 years ago

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.