Signal-Android
Signal-Android copied to clipboard
Encrypted / plaintext backup fails
- [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
Unable to create neither encrypted backup nor plaintext backup. Permission to access storage is requested, but it's already granted.
Steps to reproduce
- Click "Import / export"
- Click "Export plaintext backup" or "Export encrypted backup"
- Click "Export" at the prompt
Actual result: Asking for permission to storage, which has already been granted. No backup created. (No issues saving images, videos etc.) Expected result: Plaintext or encrypted backup.
Remark
In addition to debug log linked below, separate logcat app lists the following entry: "E/TaskPersister( 2944): File error accessing recents directory (directory doesn't exist?)."
Screenshots
Device info
Device: Motorola Moto E2 2015 LTE (surnia) Android version: Android 10 / LineageOS 17.1 (lineage-17.1-20201030-nightly) Signal version: 4.75.7.0-JW
Link to debug log
https://debuglogs.org/424c0ed84be4efe096b99663af0bfa96d5bb2b9dca4dbdfe6bfc06387cfdb567
I can't find any crash but I should add more logging to test what is going on. Are you trying to export the backups to removable storage or to internal storage?
Could be some Android 10 or LineageOS specific bug, unfortunately I don't have devices with those versions to test it on.
Recent changes for Android 10 and higher were made in the normal backup. Does that backup work? It should ask for a backup location if you activate that the first time.
That's weird... I can create an encrypted backup going via settings > chats & media. The option to backup to sd card is gone, but after activating automatic backup, I can select any folder on internal and external storage. But it's still impossible to create neither plaintext nor encrypted backup via import / export. On top I successfully made a plaintext backup last month on the same device without any issues.
The option to backup to sd card is gone
Yes, on Android 10 the same base directory is used as the one for the normal backup. Since the switch would be ignored anyway in the code I made it invisible for Android >= 10.
Something must have gone wrong, probably with the permissions and the new Android 10 code. I'll check it out.
FWIW, this also appears to be happening attempting a plaintext import under Android 10 on a Moto G7.
I implemented a quick hack in 4.75.8.0-JW that might fix this problem temporarily until I can implement a proper solution, but I can not test it. It works on lower versions of Android the same as before. Can anyone with Android 10 please try if the standard backup works, and encrypted / plaintext backup too?
I should be able to take a look at it tonight.
"Export successful"
Plaintext backup is working again on my device with LOS 17.1/Android 10.
Thank you very, very much.
Confirmed that the import begins after renaming the backup and moving it to the right location. However, the backup times out after 10 seconds. Checked the log and it reports
java.util.concurrent.TimeoutException: net.sqlcipher.database.SQLiteCompiledSql.finalize() timed out after 10 seconds
I'm gonna go ahead and open another issue for this, since it doesn't appear to be related to file IO anymore.
owever, the backup times out after 10 seconds.
This import problem is indeed something else. For a temporarily solution to get going, can you manually split the xml file and import it in parts?
May I ask how big that import file is? My xml export is around 12MB but I never tried to import it completely.
The xml backup file is ~5.7GiB, so splitting it up isn't exactly an easy solution.
Oof! That large for an xml backup, that are really a lot of messages. On my current test device I could not even test that, it would run out of storage during import. I can see if I can do the split during import, current import is done in one single database transaction, that might be too much.
@johanw666 Has there been any progress on splitting the database import?
Not yet, I've been working on getting import / export to work with Android 10 at all. It now works as it did before, but a nice proper solution probably requires the MANAGE_EXTERNAL_STORAGE permission from Android 11 because a lot of functuions require access to the File api.
That's my issue I believe. When I attempt to export as plaintext I get "Cannot write to storage". The app has access to media, but there is no other storage access option.
I have the same issue as ljanders0n. I'm on Android 11. Upon trying to export I get the error "Error, unable to write to storage". The standard Signal backup works just fine. I was excited to find this fork as I want to migrate away from WhatsApp but the very limited export functionality gave me pause. It'd be great to have the option for an automated, unencrypted backup as well
OK, for Android 11 I implemented a solution in 5.23.1. It needs some polishing in the coming releases but it works for me at the moment on an Android 11 device. Import / Export on Android 10 will remain tricky with fixed directories and needing to give access via Chats - Backups first.
I have the same problem, Android 10 on an Honor8x 5.29.1.0-JW. Gave persmission to storage and to a specific folder via Chats - Backups but all I get is "Error, unable to write storage". Standard encrypted backups via Chats - Backups work fine.
On Android 10 my fork only supports exports to [internal or removable storage]/Android/data/org.thoughtcrime.securesms/files/Signal/ . This limitation was unfortunately necessary for Android 10, where it works in the same way as Android 4 - 9 to make the full and plaintrext backup working. On Android 11 and higher the backup can be stored anywhere.