signalapp / Signal-Android

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

Signal Automatic Backup fails #13103

Open elhennig opened 1 year ago

elhennig commented 1 year ago

I activated Signal backups a longer time ago and since two days it fails with version 6.28.5 (on Android) every night with an error, that the folder was not ok or no permissions were set to write. I use the internal storage for that and it worked fine until August 9th.

I can enable to backup again (everytime with a new passphrase) and the backup completes then once. Next night during automatic execution of the backup it fails with the very same error again.

alex-signal commented 1 year ago

Hi! Could you please add a debug log? https://support.signal.org/hc/en-us/articles/360007318591-Debug-Logs-and-Crash-Reports

elhennig commented 1 year ago

The app does not crash and it seems that with 6.28.6 the backup works again. With 6.28.5 the problem was reproducible, though

elhennig commented 1 year ago

Today the problem occurred again, but the logcat does not show anything in the time when the backup should have run and for other times there is no message giving any information hat happened. The link to the debug log is https://debuglogs.org/android/6.29.2/cc78965834640abc7d68d3c4530d274780496c2df9dd3f34e677a00ca8189470

The only thing I received was a notification that the signal backup could not be performed because the backup up was deleted or moved. which is not the case. I checked that the dir is there as it was all the time. The dir is on the external SD card.

elhennig commented 1 year ago

When I reactivate the backup it has still the backup path in memory, like the planned backup time and the rest. But it creates a new security phrase every time I reactive the backup which makes it some kind of unusable

cody-signal commented 1 year ago

It appears every time you install a new version of Signal the Fairphone OS is resetting our write external storage setting. We've seen the same from other users of their devices. For now the only workaround is to reactive it, we'll look at adding a re-request permission dialog or something shortly.

elhennig commented 1 year ago

Thanks for your analysis. Strange is that the permissions obviously only vanish for the background processes, as the problem does not appear when I start the app in foreground.

cody-signal commented 1 year ago

So if you do a backup, while the app is in the foreground, it works. But if you let it happen as scheduled in the background, it fails?

elhennig commented 1 year ago

It seems this only happens once after an update or what ever causes the permissions to be removed. Between my comment from August 14th and today it worked perfectly fine with the scheduled background jobs. And last night (it is scheduled at 4:30 in the morning) it failed again.

elhennig commented 1 year ago

In the meantime I think it is not related to updates but happens after a reboot. Manual backups work fine but need a new passphrase which makes it a bit difficult to use that as workaround.

Keisial commented 1 year ago

So this permissions-being-lost is happening only when the backup is in a sd card and after a reboot (or perhaps ejecting and reinserting the card) ? What is the filesystem used by the sd card?

elhennig commented 1 year ago

I only tried to backup to the internal storage mounted under /sdcard (hence /storage/emulated/0, regular Android sdcardfs filesystem). The problem did occur on Android 12 after reboots. With A12 I had a problem with the external sd after switching to a secondary user and back, but that should not affect the intern storage. In the meantime I received an update to A13 and so far the problem did not occur again (fingers crossed ;-) )