NeoApplications / Neo-Backup

backup manager for android
GNU Affero General Public License v3.0
2.61k stars 127 forks source link

[Bug] cannot backup on Android 8.1, since 8.3.1 to lastest 8.3.8. #904

Open moe-rgb opened 2 months ago

moe-rgb commented 2 months ago

Description A clear and concise description of what the bug is.

Not Working on Android 8.1.

Steps To Reproduce

  1. give root permission
  2. tap backup
  3. show the following warning in screenshot: [ BackupAppAction$BackupFailedException: com.machiav3lli.backup.actions.BaseA ppAction$ScriptException occurred on data backup: com.machiav3lli.backup.act ions.BaseAppAction$ScriptException: tar: chdir '--exclude’ - tar: chdir ‘exclude’ ]
  4. End, all apps cannot be backuped, the one in the screenshot is just one of them. I also have Android 11 and Android 9 devices, NB worked normally for years. Only Android 8.1 Device has this problem on backup, since 8.3.1 to the lastest 8.3.8. Restore on Android 8 never has been tried because of no backups.
  5. No log found when I tap the 'log' icon in settings. It's empty inside.

Expected behavior Work normally, so that I can migrate app data.

Screenshots Only if there's no clear logs, add screenshots to help explain your problem. photo_2024-09-09_03-18-27

System Information(please complete the following information):


Additional Notes

Thanks for reporting.

hg42 commented 1 month ago
  1. No log found when I tap the 'log' icon in settings. It's empty inside.

see https://github.com/NeoApplications/Neo-Backup/blob/main/FAQ.md#how-do-i-create-a-support-log and https://github.com/NeoApplications/Neo-Backup/blob/main/FAQ.md#troubleshooting

it does not look like it's a Android version problem... (though it could be indirectly related to it).

tar: chdir --exclude sounds weird.

NB uses this as command:

$utilbox tar -c -f "$archive" -C "$dir" $exclude .

$utilbox is the found toybox executable that fits best (scoring bugs of toybox etc.).

$archive is the backup archive.

The change dir should happen because of the -C "$dir" option.

$exclude usually contains --exclude followed by a file that contains the excluded parts.

So, it seems --exclude is taken instead of $dir, but if dir would be empty there would still be an empty command line argument of "". Not sure what that old toybox tar does in that case, perhaps it ignores the empty argument and takes the next (which would be --exclude)?

Btw. you say 8.1 at some places and 8 at others, which is it? I guess it's not Android 8(.1) but the toybox executable or some other unexpected behavior of that ROM.

Since 8.3.2 you can place a toybox executable as /data/local/toybox and it will be prioritized over others. I think it is mostly standalone, but maybe it's somehow dependent on the system, just try different ones, starting with one from a system that works. If the toybox works (see the log, there is a table about the scores and which one is used and if it contains bugs etc.) and it still says this, then NB has another problem (but then it gets even weirder).