Signal-android: Backup restoration not prompted with external SD card

Created on 26 May 2018  ยท  25Comments  ยท  Source: signalapp/Signal-Android


Bug description

Couldn't restore backup until we removed the SD card.
Even with the backup copied in both internal and external storage.

Steps to reproduce

  • make a backup (in our case it was another device)
  • clear app data
  • run the app
  • see that there is no backup prompt
  • copy the "Signal" folder containing the backup to external storage if it was in the internal storage or vice versa
  • run the app
  • see that there is no backup prompt
  • remove the sd card
  • reboot
  • run the app
  • see that the backup is prompted

Might be the counterpart of to #7692 (โ† which might needs to be reopened for other reasons)

Device info

Device: Moto G3 (XT1541)
Android version: 7.1.2 (LineageOS for microG with GCM enabled)
Signal version: 4.19.3

Most helpful comment

Why not let the user choose the backup/restore path in the settings and during the registration settings?

All 25 comments

Same here with a brand new Samsung Galaxy S8 (with whatever is their latest Android version installed):

Device : samsung SM-G950F (dreamltexx)
Android : 8.0.0 (G950FXXU1CRB7, R16NW.G950FXXU1CRB7)
App : Signal 4.19.3

Once the SD card was removed, the _restore_ prompt appeared. Thanks for the workaround!

Device : samsung SM-G960U (starqltesq)
Android : 8.0.0 (G960USQU1ARBG, R16NW.G960USQU1ARBG)
App : Signal 4.19.3

Brand new Galaxy S9, fairly new to Signal, so I Googled how to backup and restore messages and followed directions at this link:

https://support.signal.org/hc/en-us/articles/360001890291

I created the backup (which was made on the internal SD and I moved to the external SD card), I moved the SD card from my S7 to the new S9, opened Signal, and never got the prompt. I copied the backup folder to the internal SD card to see if that would trigger it, but still no prompt.

I googled the issue, found this thread. Instead of physically removing the SD card and rebooting, I just went to settings/device management/storage/storage settings and unmounted the card. I then re-opened signal and was immediately prompted as expected. Entered my code, and it appears to have restored. I then went back and re-mounted the card.

However, when I tried to register I now get "Unable to contact service. Check network connection and try again." Hopefully that's just a strange coincidence and it will work in a little while.

EDIT: Registered fine after trying again a while later and all messages are there. However, I noticed I can't create a new backup now. It just counts or whatever and then says last backup created was never.

EDIT 2: I got to thinking about how it only saw the backup without the SD card, so I thought maybe it will only make backups that way too.

Dismounted the SD card again and Signal no longer said "never" for last backup, but instead gave the proper date of the backup I had used. It also created a new backup successfully.

Clearly there is something wrong with the way it interacts with devices using external SD cards.

I believe this should be fixed as of 70c2a863cca7984fec072913148fb4651e9644e4 (which would be in 4.20.5). Please re-open if it's still an issue. Thanks!

I tried it yesterday and was unable to restore a backup. Creating backups worked fine though. I copied the Signal folder to internal storage and SD card, but Signal didn't see them. With a SD card, backups will be stored under /Android/data/org.thoughtcrime.securesms/files/Signal/Backups. I think this is not a good place to store backups. They are some kind of hidden, you have to know that they are there. If you uninstall Signal, Android will delete Signal's data folder on the external storage, and your backups are gone. And if you want to restore a backup, you have to create the mentioned directory. I didn't test the latter, but most likely, Signal will only look there, if it sees the device has external storage.
I know there are limitation, that Apps won't have permissions to read/write to the external storage directly, unless explicitly granted (Storage Access Framework). But with the SAF, you could let the user decide, where backups are stored. Another way to improve the user experience on a fresh install would be, if the user has the option to pick a backup from file system (DocumentProvider).

Tested it with 4.20.6.

@bbukowski Yeah, so the intended behavior is that the backup is stored in /sdcard/Signal/Backups, which is persisted across installs. I can look into what happens with external storage.

Device: Samsung Galaxy S5 mini
Android version: 7.0.1 (LineageOS)
Signal version: 4.20.6

I ran into the described case yesterday. Wanted to reinstall Signal and pushed the backup button in the settings menu. After some time i double checked and saw a 'last backup: 22min'. So i reinstalled Signal, but there was no backup to restore. If the backup file was in /Android/data/org.thoughtcrime.securesms/files/Signal/Backups (is empty), it got deleted and i wasn' t abled to get my messages back.

I have the same problem. I changed phones and wanted to transfer my messages, I backed up on the old phone with no problem, but the new phone will neither see the Signal directory to restore nor create any backups of its own (maybe because there are no messages, though).

I was having the same problem with the failed restoration with several recent versions of Signal (4.19.* and 4.20.*). The backup had been placed in /sdcard/Signal/Backups. No amount of messing with permissions, unplugging SD cards, or rebooting did anything. I could see in the log files that the directory was read but that no import attempt was made. After pulling my hair out, I found this thread and checked to see what was in /storage/[externalsdcard]/Android/data/org.thoughtcrime.securesms/files/Signal/Backups. There was no such directory but creating it and moving the back up to it solved the problem. Hope that helps someone else.

Hmm, that didn't work for me. How did you restore the backup in the UI, @1xPdd? I don't even see the option.

@skorokithakis If Signal has not yet been registered (i.e. its app data has been cleared or it's a fresh install), it prompts you to restore upon starting the app, provided that it detects a backup file. After restoring, you go through the normal registration flow with SMS or voice call verification.

Thank you, @haffenloher. Unfortunately, clearing data and copying the backup over still didn't make Signal detect it. I'll wait, thanks again.

@skorokithakis. I cleared all storage and killed Signal. It finally detected the backup the next time I started Signal. I was pretty frustrated and was about to uninstall Signal. This seems a pretty poor design choice. I'm not sure why a small import button allowing the user to select the backup file is not possible.

@1xPdd I tried that again, this time putting the backup in the above directory but on the SD card. It worked after I did that, luckily. I agree, a button in the "restore backup" section (since there is one already) would have been much better UX.

Supporting external SD cards was a mistake. I got badgered into it by people here, but never should have done it. I think the action item for this ticket is to check both the external SD card location and the "external storage" location looking for a backup to restore, if there is an external SD card present.

I don't know, SD cards are extremely useful for backups. As you say, the bug is that the location isn't checked, not that SD is supported. Also, for some reason, selecting "backup" on my old phone put the backup on the root of the partition, not under the Android dir. That seems to me like a better location anyway, but I would like to mention the inconsistency.

@skorokithakis It's supposed to put it in the root. If it's in the Android dir, it'll get deleted when the user uninstalls the app. At least that's the case on internal storage. Maybe that folder on the external SD card doesn't get deleted? I have to investigate.

Ah I think that might be the problem. It backs up to the root but expects the backup to be in the Android dir. At least that's what I think worked for me (but I had the backup on all four possible locations).

@greyson-signal It gets deleted there too.

It gets deleted there too.

Can confirm.

Why not let the user choose the backup/restore path in the settings and during the registration settings?

Here's a rundown on what the issue is here:

1) Currently, if the user has an external SD card, we will store the backup there (and look for it there during the restore process).
2) Unfortunately, when storing the backup on the external SD card, it gets put in an app-specific folder that gets deleted when the app is uninstalled. This makes storing backup data in that folder a non-option.
3) There's no reliable way to store data in the root of an external SD card. Just obtaining permission to do so is a hilarious exercise that isn't practical for our purposes.

Given this, we've opted to revert to the previous behavior of always storing the backup in the regular 'ol Environment.getExternalStorageDirectory() -- which, despite it's name, is typically on internal storage.

We plan on shipping this change in 4.23.

Thank you!

@moxie0 I am just curious about argument behind "Supporting external SD cards was a mistake. I got badgered into it by people here, but never should have done it. ". The thing is that being security inexperienced I see SD card as natural idea to backup location, just by curiosity I would like to know reasoning why it is not good idea?

@vbspam

The thing is that being security inexperienced I see SD card as natural idea to backup location

It's seems that it's a mess in Android to handle well all the cases because unfortunately, it doesn't seem so simple to use the SD card.

I see SD card as natural idea to backup location

Me too, because if the phone is broken, then data on the SD card is still easily recoverable.

@nekromoff

many, many thanks for pointing signal-back. It helped me. Funny thing - when you import xml in SMS B&R, you need to put it into app's default directory with name like it's backup files.

Regards!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donjoe0 picture donjoe0  ยท  3Comments

hiredgunhouse picture hiredgunhouse  ยท  3Comments

wesinator picture wesinator  ยท  3Comments

notthematrix picture notthematrix  ยท  3Comments

halb9 picture halb9  ยท  3Comments