Neo-Backup icon indicating copy to clipboard operation
Neo-Backup copied to clipboard

[Bug] Error "a: PackageManager returned invalid data paths after trying 30 seconds to retrieve them" when restoring

Open ghost opened this issue 3 years ago • 12 comments

Description When trying to restore an encrypted backup on a USB drive, the process fails with the message:

a: PackageManager returned invalid data paths after trying 30 seconds to retrieve them

That message is repeated for every backed-up app .

Steps To Reproduce

  1. Mount the USB drive containing the backup
  2. The backed-up apps are correctly shown. I select all of them (or a subset of them)
  3. I click the "Restore" link
  4. The restoration starts and eventually I get one message error for each app.

Expected behavior The applications are correctly restored.

System Information(please complete the following information):

  • Device: OnePlus Nord
  • Android Version: Android 12 (Pixel Extended). The backup was made with Android 10 (LineageOS)
  • App's Version: 8.0.2

Additional Notes

  • If you're on the latest Test version(from the TG-Channel or Matrix-Room) please report there directly, not here.

  • If you're on the latest github version:

    • Please read the FAQ first.
    • Please read all the open Issues. If one does match yours, leave a comment there if there's some extra information you can provide.
  • If you're not on the latest github version. Update, then make sure that the bug is still there. If it's go further with reporting.

Thanks for reporting.

ghost avatar Jun 30 '22 20:06 ghost

this error is somehow special and we still don't know why and how it happens.

What we know:

  • the apk is installed
  • when we ask the package manager (the part of the ROM that installs the apk) for the data directory, we get an empty path
  • so as a workaround, we retry this for a configurable time (default: 30 sec, you could try to increase it to something very long, let's say 10 min...)
  • usually it's a permanent problem, restoring again doesn't help, only reboot as far as I remember
  • it has nothing to do with the backup storage or with system file access, because it happens immediately after the installation of the apk

As far as I know, an unknown change from v7 to v8 reduced this to a very rare case. This is even more mysterious and this also means, we cannot test it anymore (e.g. I have not seen it again since then).

So, this makes you the one and only test subject :-)

Please, first try to enable "Use Session Installer" in the service settings

hg42 avatar Jun 30 '22 22:06 hg42

Thanks for your response, Harald. I'm "glad" to be so special :-) Anyway, I'm sorry but I'm not sure how to enable that session installer. Is it something you do on the app store (I seem to remember having seen something similar on Aurora Store)? If so, I can't find such option on F-droid, which is what I used to install the application.

ghost avatar Jul 01 '22 21:07 ghost

LOL, it's in NB preferences, service preferences, below "Back up media files"

hg42 avatar Jul 03 '22 01:07 hg42

I had checked out those settings and didn't find such option. Right below "Back Up media files" there is "Restore permissions" En domingo, 3 de julio de 2022 03:28:55 CEST, Harald @.***> escribió:

LOL, it's in NB settings, service settings, below "Back up media files"

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ghost avatar Jul 03 '22 11:07 ghost

ok, then you need a newer apk, latest from the Telegram group (not sure if this is accessible via Matrix)

hg42 avatar Jul 03 '22 13:07 hg42

it was added in adb9384cfe0e3619019498d2c105c45310074381

hg42 avatar Jul 03 '22 13:07 hg42

Tried with session installer. Same problem :-( En domingo, 3 de julio de 2022 15:57:50 CEST, Harald @.***> escribió:

it was added in adb9384

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ghost avatar Jul 04 '22 13:07 ghost

Ok, it seems that I won't be able to restore my backup. Is there at least a way of manually retrieving some data from it, or should I get it into my head that I've lost all my data?

ghost avatar Jul 06 '22 19:07 ghost

the files are usual tar archives of the variouss data directories, they are gzipped (.tar.gz) if compression is >0 and encrypted in your case (.enc).

The encryption is the main problem (that's why I don't do that myself, if I need encryption I do it myself).

Nils was so kind to create a program (for desktop I think), that can decrypt the files.

As far as I read in telegram, there should be a link in the faq (we expect users to read that :-))

hg42 avatar Jul 07 '22 02:07 hg42

our theory is, that installing the apk puts the package manager into a state that is somehow not consistent. Or may be the installer and the part that gives us the directory paths need some trigger.

So it may be a workaround, to separate installing the apk from installing the data. "separate" can be more or less. Any state should be gone after a reboot. But may be there are other possibilities (I have no idea, yet).

For testing, I would choose an app, that is not crucial.

Did you already try to first restore the apk and later restore data? And may be reboot in between for maximum separation (as we know, time does not help, assuming you already increased the 30 sec? it's also in dev settings).

Or install the apk from play store and restore the data with NB?

Also restore the apk, then restore apk+data may make a difference (reinstalling is different from a fresh install)

hg42 avatar Jul 07 '22 02:07 hg42

I'm getting this same error trying to restore Instagram. Backed up on an older phone (Xiaomi Redmi 9; Android 10; MIUI 12.0.2 [stock]), restore attempt on newer phone (Xiaomi 10 lite 5G; Android 12; MIUI by xiaomi.eu 13.0.3). Magisk rooted on both. Neo Backup 8.1.3 on both (one from github package, one from F-Droid if that makes a difference). Wondering if fs-verity is the tricky spot.

logcat:

10-03 11:56:12.124  1523 22149 E installd: Couldn't opendir /data/app/vmdl1617918121.tmp: No such file or directory
10-03 11:56:12.124  1523 22149 E installd: Failed to delete /data/app/vmdl1617918121.tmp: No such file or directory
10-03 11:56:12.155  4253  4253 E SLAAppLib: initBroadcastReceivercom.instagram.android
10-03 11:56:12.166  2848  2897 E InstallApkReceiver: uninstall:package:com.instagram.android
10-03 11:56:12.174   960   960 E [email protected]: Unknown params
10-03 11:56:12.184   960   996 E ANDR-PERF-LM: FeatureState: deleteRow() 205: Entry not found in db
10-03 11:56:12.220  2111  2402 E AppScanObserverService: Try to add a invalid package: com.instagram.android | 10248 | 0
10-03 11:56:12.226  4253  4253 E SLAAppLib: initBroadcastReceivercom.instagram.android
10-03 11:56:12.244  4483 12713 E AppCompatManager: getIncompatibleAppList exception: 
10-03 11:56:12.244  4483 12713 E AppCompatManager: java.lang.ClassNotFoundException: miui.security.appcompatibility.AppCompatibilityManager
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.classForName(Native Method)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.forName(Class.java:454)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.forName(Class.java:379)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.b(Unknown Source:7)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.a(Unknown Source:0)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.a(Unknown Source:4)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.g.a$a.a(Unknown Source:12)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.g.a$a.doInBackground(Unknown Source:2)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at android.os.AsyncTask$3.call(Unknown Source:20)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Thread.run(Thread.java:920)
10-03 11:56:12.244  4483 12713 E AppCompatManager: Caused by: java.lang.ClassNotFoundException: miui.security.appcompatibility.AppCompatibilityManager
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	... 13 more
10-03 11:56:12.244  4483 12713 E AppCompatManager: setIncompatibleAppList exception: 
10-03 11:56:12.244  4483 12713 E AppCompatManager: java.lang.ClassNotFoundException: miui.security.appcompatibility.AppCompatibilityManager
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.classForName(Native Method)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.forName(Class.java:454)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Class.forName(Class.java:379)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.c(Unknown Source:2)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.a(Unknown Source:29)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.b.a(Unknown Source:4)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.g.a$a.a(Unknown Source:12)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at com.miui.appcompatibility.g.a$a.doInBackground(Unknown Source:2)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at android.os.AsyncTask$3.call(Unknown Source:20)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	at java.lang.Thread.run(Thread.java:920)
10-03 11:56:12.244  4483 12713 E AppCompatManager: Caused by: java.lang.ClassNotFoundException: miui.security.appcompatibility.AppCompatibilityManager
10-03 11:56:12.244  4483 12713 E AppCompatManager: 	... 13 more
10-03 11:56:12.267  2848  2897 E InstallApkReceiver: install:package:com.instagram.android
10-03 11:56:12.403  4253  4253 E SLAAppLib: initBroadcastReceivercom.instagram.android
10-03 11:56:12.478   960   960 E [email protected]: Unknown params
10-03 11:56:12.484   960   996 E ANDR-PERF-LM: MetaMeter: handleAsync() 164: AdaptLaunch Invalid Async
10-03 11:56:12.504  2111  2230 E VerityUtils: Failed to measure fs-verity, errno 1: /data/app/~~5fkqw_iRFg6lqJK6_ixpHQ==/com.instagram.android-_tMdbKt85bdbhRErEtkOcg==/base.apk
10-03 11:56:12.553   960   960 E [email protected]: Unknown params
10-03 11:56:12.590  2111  2230 E VerityUtils: Failed to measure fs-verity, errno 1: /data/app/~~5fkqw_iRFg6lqJK6_ixpHQ==/com.instagram.android-_tMdbKt85bdbhRErEtkOcg==/base.apk
10-03 11:56:12.596   960   960 E [email protected]: Unknown params

Possibly related bug: https://github.com/NeoApplications/Neo-Backup/issues/367

waveletlet avatar Oct 03 '22 19:10 waveletlet

Tried installing the app from the Play Store and was able to restore data (but was immediately logged out as in https://github.com/NeoApplications/Neo-Backup/issues/634), so it does seem to be a problem with the apk part of the restore.

Before trying the Play Store install, I tried restoring from backups with and without cache, with and without permissions, and with compression levels 2 and 0. No encryption on any.

waveletlet avatar Oct 03 '22 19:10 waveletlet