jensstein / oandbackup

backup manager for android
Other
544 stars 193 forks source link

Backups fail with java.io.FileNotFoundException [Android 6.0] #145

Open RalfJung opened 7 years ago

RalfJung commented 7 years ago

When I select any app to make a backup, and I select "FIles + APK", oandbackup shows a notification "backup failed". oandbackup's own log doesn't have anything interesting, but "adb logcat" does:

12-23 12:50:06.285  6794  9404 W System.err: java.io.FileNotFoundException: /storage/25AC-1ADF/OAndBackup/cgeo.geocaching/cgeo.geocaching.zip: open failed: EACCES (Permission denied)
12-23 12:50:06.300  6794  9404 W System.err:    at libcore.io.IoBridge.open(IoBridge.java:452)
12-23 12:50:06.300  6794  9404 W System.err:    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
12-23 12:50:06.300  6794  9404 W System.err:    at java.io.FileOutputStream.<init>(FileOutputStream.java:72)
12-23 12:50:06.300  6794  9404 W System.err:    at dk.jens.backup.Compression.zip(Compression.java:27)
12-23 12:50:06.300  6794  9404 W System.err:    at dk.jens.backup.ShellCommands.compress(ShellCommands.java:599)
12-23 12:50:06.300  6794  9404 W System.err:    at dk.jens.backup.ShellCommands.doBackup(ShellCommands.java:132)
12-23 12:50:06.300  6794  9404 W System.err:    at dk.jens.backup.BackupRestoreHelper.backup(BackupRestoreHelper.java:39)
12-23 12:50:06.300  6794  9404 W System.err:    at dk.jens.backup.OAndBackup$1.run(OAndBackup.java:152)
12-23 12:50:06.300  6794  9404 W System.err:    at java.lang.Thread.run(Thread.java:818)
12-23 12:50:06.300  6794  9404 W System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
12-23 12:50:06.302  6794  9404 W System.err:    at libcore.io.Posix.open(Native Method)
12-23 12:50:06.302  6794  9404 W System.err:    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
12-23 12:50:06.302  6794  9404 W System.err:    at libcore.io.IoBridge.open(IoBridge.java:438)
12-23 12:50:06.302  6794  9404 W System.err:    ... 8 more
12-23 12:50:06.302  6794  9404 I oandbackup: java.io.FileNotFoundException: /storage/25AC-1ADF/OAndBackup/cgeo.geocaching/cgeo.geocaching.zip: open failed: EACCES (Permission denied)
12-23 12:50:06.313  6794  9404 I oandbackup: return: 1 / Fehler!
12-23 12:50:06.316  6794  9404 E oandbackup: LogFile.writeLogFile: java.io.IOException: open failed: EACCES (Permission denied)
12-23 12:50:06.336  6794  6794 E oandbackup: cgeo.geocaching: error while reading logfile: org.json.JSONException: Value java.io.FileNotFoundException of type java.lang

I tried reinstalling oandbackup, to no avail. The same error occurs with all other apps that I tried. I tried deleting the folder /storage/25AC-1ADF/OAndBackup. The error stays the same. After this failed, attempt, the folder /storage/25AC-1ADF/OAndBackup/cgeo.geocaching does exist (again), so the app clearly has permissions to create it. The zip file mentioned in the log indeed does not exist.

This is on Android 6.0 (CM 13.0) with oandbackup 0.2.11.

DocSniper commented 7 years ago

Same problem on my phone with CM 14.1

mrtnmtth commented 7 years ago

I can confirm this (CM 13.0 with oandbackup 0.2.11). This only happens if backup folder is on external SD card. So might be related to #125.

RalfJung commented 7 years ago

Indeed this is probably a duplicate; changing the path to .../Android/data/dk.jens.backup/files fixed the issue.