mtkennerly / ludusavi-playnite

Playnite plugin for save backups via Ludusavi
MIT License
171 stars 10 forks source link

Unable to run ludusavi error on Playnite 10.32 #67

Closed Darkcitrus closed 11 months ago

Darkcitrus commented 11 months ago

Playnite, ludusavi, and the plugin are all the latest version & ludusavi runs standalone just fine, but playnite can no longer backup any saves with it, always giving the same error of unable to run ludsavi. image

image

image

mtkennerly commented 11 months ago

Hi! I'm not able to reproduce this. Could you upload a copy of your extensions.log from Playnite?

Darkcitrus commented 11 months ago

extensions.log extensions.00000.log I found two of them. in extensions.00000.log I found some related entries to ludusavi, here you go:


07-11 20:19:28.205|DEBUG|LudusaviPlaynite#LudusaviPlaynite:Ludusavi could not be executed
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at LudusaviPlaynite.LudusaviPlaynite.RunCommand(String command, String args)
   at LudusaviPlaynite.LudusaviPlaynite.InvokeLudusaviDirect(Invocation invocation, Boolean standalone)
07-11 20:19:28.205|DEBUG|LudusaviPlaynite#LudusaviPlaynite:Ludusavi exited with -1 and invalid JSON content
System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at LudusaviPlaynite.LudusaviPlaynite.InvokeLudusavi(Invocation invocation)
mtkennerly commented 11 months ago

Could you try opening Command Prompt and running these commands?

set RUST_BACKTRACE=1
C:\Games\ludusavi.exe --try-manifest-update find --api --backup -- "Baldur's Gate III"

That's the last command that failed in extensions.log:

30-12 16:12:56.526|DEBUG|LudusaviPlaynite#LudusaviPlaynite:Running Ludusavi: --try-manifest-update find --api --backup -- "Baldur's Gate III"
30-12 16:12:58.985|DEBUG|LudusaviPlaynite#LudusaviPlaynite:Ludusavi exited with 101 and invalid JSON content
Darkcitrus commented 11 months ago

image Here's what came up.

Darkcitrus commented 11 months ago

(c) Microsoft Corporation. All rights reserved.

C:\Users\Dark>set RUST_BACKTRACE=1

C:\Users\Dark>C:\Games\ludusavi.exe --try-manifest-update find --api --backup -- "Baldur's Gate III"
thread 'main' panicked at src\scan\layout.rs:442:44:
called `Result::unwrap()` on an `Err` value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

C:\Users\Dark>
C:\Users\Dark>set RUST_BACKTRACE=1

C:\Users\Dark>C:\Games\ludusavi.exe --try-manifest-update find --api --backup -- "Baldur's Gate III"set RUST_BACKTRACE=1
thread 'main' panicked at src\scan\layout.rs:442:44:
called `Result::unwrap()` on an `Err` value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

C:\Users\Dark>C:\Games\ludusavi.exe --try-manifest-update find --api --backup -- "Baldur's Gate III"
Darkcitrus commented 11 months ago

After a few tries, nothing comes up anymore. image

mtkennerly commented 11 months ago

Thanks, that narrows it down. Somehow, one of the mapping.yaml files from your backups got into an invalid state, but I'm not sure how that could be. Do you have any other scripts/plugins that might have modified the backup folder?

Since it suddenly started working, it seems that the file either disappeared or got fixed, so you should be okay for now, but let me know if you still have any issues in Playnite.

I'll definitely update Ludusavi so that this kind of error doesn't make the whole program crash. I'm just not sure how the issue appeared in the first place.

Darkcitrus commented 11 months ago

Well, it still doesn't work on my end even if if the cmd does, I still get the same errors in Playnite regardless of which game I'm trying to backup.

If it's any hint to how this happened, I think it started happening around the same time I re-attached several storage drives that weren't in use prior to installing ludusavi/playnite, one of which had an older version of ludusavi on it (without playnite).

Darkcitrus commented 11 months ago

Update, your hint about mapping.yaml got me to figure out that changing the directory in which saves are stored (from C:\Users\Dark\ludusavi-backup to C:\Users\Dark\ludusavi-playnite) seems to fix it fully for me, now backing up works via Playnite just fine!

I'm not sure if I should close the issue since my problem was resolved or leave it open since the root of it is still to be fixed though!

I'll leave it open for you to do with it as you see fit, thank you for helping out with this. :)

mtkennerly commented 11 months ago

Glad you found a solution that works for you :)

If you'd still like to troubleshoot your original backups and get them working, then you can try this build with a fix for the "did not contain valid UTF-8" crash:

ludusavi-v0.22.0-post.6+4489f49-win64.zip (generated from https://github.com/mtkennerly/ludusavi/commit/4489f494db9fc13532e5191751dc98f15ba1c1ab)

If you still see issues in Playnite with that build, then I'd like to see the updated extension.log from Playnite and a copy of %APPDATA%\ludusavi\ludusavi_rCURRENT.log (if it exists).

Darkcitrus commented 11 months ago

Sure, I'll try it out and set the old backups! Will update when I do.

Darkcitrus commented 11 months ago

Update, the new build works with the old backups, so all is well!

mtkennerly commented 11 months ago

Great! Thanks for confirming.

If you're curious which specific backup is corrupted, then %APPDATA%\ludusavi\ludusavi_rCURRENT.log should have a line like Ignoring unloadable mapping: with the path to the relevant game. I can try to help salvage it if you send me the game backup folder, or if you're not too worried about it, then you could just delete the folder for that game's backups.

Darkcitrus commented 10 months ago

Ah, it was a random save game for Metro 2033, that's totally fine with me to get rid of but thank you for the offer! Your software is the best at keeping backups of my saves really. :)