NeoApplications / Neo-Backup

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

[Bug] Log JSON parsing fails on "sdkVersion" #678

Open Tmpod opened 1 year ago

Tmpod commented 1 year ago

Description

Restoring any app from my previous phone fails, and upon checking the logs I find multiple occurrences of this error:

2021-12-19-10-22-36.log. [oc.j] oc.j: Unexpected JSON token at offset 61: Encountered an unknown key 'sdkVersion' at path: $.deviceName
Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
JSON input: ......913\",\"deviceName\":\"santoni\",\"sdkVersion\":\"9\",\"cpuArch\":\"arm.....
at b8.b.<init>(SourceFile:6)
at q8.x.n(Unknown Source:69)
at b9.a.l(Unknown Source:8)
at zb.k0.run(Unknown Source:100)
at ec.g.run(Unknown Source:11)
at gc.j.run(Unknown Source:2)
at gc.a$a.run(Unknown Source:81)"}

(I've inserted line breaks to ease readability)

Above that error was this:

Unable to process /tree/primary:oandbackupx/document/primary:oandbackupx/LOGS

I checked the top of the logs and noticed a key sdkCodename, right at the beginning, so my guess is that you changed that and it isn't backwards compatible. I have checked the "Allow older versions" advanced option in the settings.

Steps To Reproduce

  1. Copy the backups folder (with backups from multiple dates) from an older phone (in this case, running NeoBackup 8.1.3) into a new device (running 8.2.0)
  2. Attempt to restore the data for just one app
  3. Wait for some 30s and it fails.

Expected behavior

NeoBackup would restore the app data from the latest backup in the folder.

Screenshots

~

System Information(please complete the following information):

hg42 commented 1 year ago

I think, this has nothing to do with the restore failures (as far as I can see with those minified names).

NB tries to read the Logs and fails. For some reason it is saved to a new log entry. Do you get an error and press Save (in case there is a button)? Or does it crash and you have the devSetting catchUncaughtException enabled?

If you delete the LOG folder, this will stop.

According to the restore problems, please create a new issue. Do you have Telegram? For bug reports it would be better to use a "neo" version, that has minified names disabled. You usually find it in the group, look at pinned messages.

Tmpod commented 1 year ago

Hello, sorry for necro... In sorta forgot about this 😅

I managed to progress a bit, I no longer get that error after doing what you suggested, however now it yields a IOException saying the archive isn't in .gz. I checked and indeed it's not that, but rather .gz.enc. Now, I set an encryption password in the settings, so shouldn't it attempt to decrypt the archive first?

Thanks a lot for the help :)

hg42 commented 1 year ago

I think if it's the wrong password, the decrypted result is still not in gz format. I don't use encryption, so I'm not sure if it would complain about a decryption error or simply create garbage (which may be more secure)

Tmpod commented 1 year ago

I'm quite positively certain the password is correct, but I will triple check hehe

hg42 commented 1 year ago

but first you should update to the latest version

it doesn't make sense to mix in issues from older versions, that may already be solved

ideally use the 8.3.2-beta01 from the telegram group, if you have access. From my POV any advanced user should be a member of that group. (or use the matrix group, if you fear Telegram)