mtkennerly / ludusavi

Backup tool for PC game saves
MIT License
2.08k stars 48 forks source link

Backup fails for Parkitect save data on Steam deck (likely affects backup for any files with a colon in the name) #351

Closed joelnb closed 1 month ago

joelnb commented 1 month ago

Ludusavi version

v0.24.0

Operating system

Linux (Steam Deck)

Installation method

Flatpak

Description

Since updating to 0.23.0 (and it is also true in the latest version which is why I selected that I am using 0.24.0) I have been unable to backup data for one game - Parkitect. This was working with the 0.22.0 version of ludusavi and if I revert to this version of the flatpak it still works fine:

    Commit: 18a832d7765360f70de8e555071775f65f97bf65d4c207da06e5ff56f38c3988
   Subject: Add permission for other apps' data to make custom backups easier (28c47900)
      Date: 2024-01-03 22:46:18 +0000

This is why I didn't investigate the problem much until now - I had things working on the old version.

If I just backup this one game I get this output for the failure:

Parkitect [1.91 KiB] [+]:
  - [+] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/.sync
  - [+] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Blueprints/workshop_files.dat
  - [+] [FAILED] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial_ Loopy Lagoon.park
    - No such file or directory (os error 2)
  - [+] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/workshop_files.dat
  - [+] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Scenarios/workshop_files.dat
  - [+] /home/deck/.local/share/Steam/userdata/39075139/453090/remote/campaign
  - [+] /home/deck/.local/share/Steam/userdata/39075139/453090/remote/prgrs.ach
  - [+] /home/deck/.local/share/Steam/userdata/39075139/453090/remote/sync
  - [+] /home/deck/.local/share/Steam/userdata/39075139/453090/remote/workshop_files.dat

Overall:
  Games: 1 [+1]
  Size: 1.91 KiB
  Location: /home/deck/Ludu
Some entries failed to process; look for FAILED in the output for details. Double check whether you can access those files or whether their paths are very long.

The path /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial_ Loopy Lagoon.park does not exist and the actual path which should be backed up is /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial: Loopy Lagoon.park but ludusavi no longer tries this.

I was able to track this down to this piece of code and I confirmed that commenting out that code fixes the issue - if I build the latest commit it still fails but if I build the latest commit with that if statement removed I get the expected (working) output:

Parkitect [341.64 KiB] [Δ]:
  - /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/.sync
  - /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Blueprints/workshop_files.dat
  - [+] /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial: Loopy Lagoon.park
  - /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/workshop_files.dat
  - /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Scenarios/workshop_files.dat
  - /home/deck/.local/share/Steam/userdata/39075139/453090/remote/campaign
  - /home/deck/.local/share/Steam/userdata/39075139/453090/remote/prgrs.ach
  - /home/deck/.local/share/Steam/userdata/39075139/453090/remote/sync
  - /home/deck/.local/share/Steam/userdata/39075139/453090/remote/workshop_files.dat

Overall:
  Games: 1 [Δ1]
  Size: 341.64 KiB
  Location: /home/deck/Ludu

I would have loved to do a PR for this given that I identified the affected code but sadly I wasn't able to determine the best way of fixing this in a way that won't negatively impact Windows users & I have no ability to test a fix on Windows.

Logs

[2024-06-11T20:48:57.342Z] DEBUG [ludusavi] Version: 0.24.0
[2024-06-11T20:48:57.343Z] DEBUG [ludusavi::cli] Config on startup: Config { runtime: Runtime { threads: None }, manifest: ManifestConfig { url: "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml", secondary: [] }, language: English, theme: Light, roots: [RootsConfig { path: StrictPath { raw: "/home/deck/.local/share/Steam", basis: None }, store: Steam }, RootsConfig { path: StrictPath { raw: "/run/media/mmcblk0p1", basis: None }, store: Steam }], redirects: [], backup: BackupConfig { path: StrictPath { raw: "/home/deck/ludusavi-backup", basis: None }, ignored_games: {}, filter: BackupFilter { exclude_store_screenshots: false, cloud: CloudFilter { exclude: false, epic: false, gog: false, origin: false, steam: false, uplay: false }, ignored_paths: [], ignored_registry: [] }, toggled_paths: ToggledPaths({}), toggled_registry: ToggledRegistry({}), sort: Sort { key: Name, reversed: false }, retention: Retention { full: 1, differential: 0, force_new_full: false }, format: BackupFormats { chosen: Simple, zip: ZipConfig { compression: Deflate }, compression: Compression { deflate: DeflateCompression { level: 6 }, bzip2: Bzip2Compression { level: 6 }, zstd: ZstdCompression { level: 10 } } } }, restore: RestoreConfig { path: StrictPath { raw: "/home/deck/ludusavi-backup", basis: None }, ignored_games: {}, toggled_paths: ToggledPaths({}), toggled_registry: ToggledRegistry({}), sort: Sort { key: Name, reversed: false } }, scan: Scan { show_deselected_games: true, show_unchanged_games: true, show_unscanned_games: true }, cloud: Cloud { remote: None, path: "ludusavi-backup", synchronize: true }, apps: Apps { rclone: App { path: StrictPath { raw: "", basis: None }, arguments: "" } }, custom_games: [] }
[2024-06-11T20:48:57.343Z] DEBUG [ludusavi::cli] Invocation: Backup { preview: false, path: Some(StrictPath { raw: "/ludusavi-backup2", basis: None }), force: true, wine_prefix: None, api: false, sort: None, format: None, compression: None, compression_level: None, full_limit: None, differential_limit: None, cloud_sync: false, no_cloud_sync: false, games: ["Parkitect"] }
[2024-06-11T20:48:58.498Z] DEBUG [ludusavi::scan::launchers] Scanning launcher info: Steam - /home/deck/.local/share/Steam
[2024-06-11T20:48:58.498Z] DEBUG [ludusavi::scan::launchers::generic] ranking installations for Steam: /home/deck/.local/share/Steam
[2024-06-11T20:48:58.498Z] DEBUG [ludusavi::scan::launchers::generic] actual install folders: swkotor | Portal | Balatro | The Witcher 3 | SongsOfConquest | SteamWorld Dig 2 | WormsGolf2010 | Steamworks Shared | Necesse | SteamLinuxRuntime_sniper | Stacklands | Brotato | Wonderputt Forever | SteamLinuxRuntime_soldier | Terraria | Fable Anniversary | BadNorth | Proton 8.0 | OrganTrailDC | Parkitect | MiniMetro | Half-Life 2 | Fly Corp | Railgrade | PlateUp | Vampire Survivors | SteamLinuxRuntime | shapez.io | TheCave | Golf With Your Friends | Proton 9.0 (Beta) | Unrailed | OxygenNotIncluded | Islanders | TPH | Plan B Terraform | Trials Fusion | LEGO Star Wars - The Skywalker Saga | Pinball FX3 | Factorio | Rail Route | Steam Controller Configs | Mini Motorways | The Jackbox Party Pack 7 | Black Mesa | Overcooked | The Battle of Polytopia | Morrowind | Dorfromantik | Dead Cells | Aperture Desk Job | The Wandering Village | Marble World | Moving Out | Teardown | Age2HD | Geometry Wars | Rayman Legends | Crafty Survivors | Golf Peaks | Railbound | Halls of Torment | Proton - Experimental | Rusted Warfare | Boomerang Fu | Portal Reloaded | Descenders | Tricky Towers | Proton EasyAntiCheat Runtime | Proton Hotfix | Deep Rock Survivor | Urbek | LEGO Indiana Jones The Original Adventures | Enter the Gungeon | Deep Rock Galactic | BloonsTD6 | Star Wars Republic Commando | Cassette Beasts | WormsRevolution | Nordic Ashes | ForzaHorizon4 | The Witness | TrialsPC | The Escapists 2 | Soulstone Survivors | Red Dead Redemption 2 | Proton 7.0 | Room to Grow | word factori | RimWorld | Marvel's Spider-Man Remastered | Worms Armageddon | Spore | KeyWe | ClusterTruck | Max Payne 2 The Fall of Max Payne | Threes | Max Payne | Northgard
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers::generic] [Parkitect] selecting subdir with score 9223372036854775807: Parkitect
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers] launcher games found (Steam - /home/deck/.local/share/Steam): {
    "Parkitect": {
        LauncherGame {
            install_dir: Some(
                StrictPath { raw: "/home/deck/.local/share/Steam/steamapps/common/Parkitect", basis: None },
            ),
            prefix: None,
            platform: None,
        },
    },
}
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers] Scanning launcher info: Steam - /run/media/deck/f0139c7b-c42c-45a4-808a-0b7e50b21696
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers::generic] ranking installations for Steam: /run/media/deck/f0139c7b-c42c-45a4-808a-0b7e50b21696
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers::generic] actual install folders: Baldurs Gate 3 | STAR WARS Squadrons | Ratchet & Clank - Rift Apart | Dying Light | Assassins Creed Odyssey | Marvel's Guardians of the Galaxy
[2024-06-11T20:48:58.499Z] DEBUG [ludusavi::scan::launchers] launcher games found (Steam - /run/media/deck/f0139c7b-c42c-45a4-808a-0b7e50b21696): {}
[2024-06-11T20:48:58.501Z] INFO [ludusavi::cli] beginning backup with 1 steps
[2024-06-11T20:48:58.503Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/userdata/39075139/453090/remote/sync
[2024-06-11T20:48:58.503Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/userdata/39075139/453090/remote/workshop_files.dat
[2024-06-11T20:48:58.503Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/userdata/39075139/453090/remote/campaign
[2024-06-11T20:48:58.503Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/userdata/39075139/453090/remote/prgrs.ach
[2024-06-11T20:48:58.504Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/.sync
[2024-06-11T20:48:58.504Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial_ Loopy Lagoon.park
[2024-06-11T20:48:58.504Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/workshop_files.dat
[2024-06-11T20:48:58.504Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Blueprints/workshop_files.dat
[2024-06-11T20:48:58.504Z] DEBUG [ludusavi::scan] [Parkitect] found: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Scenarios/workshop_files.dat
[2024-06-11T20:48:58.504Z] INFO [ludusavi::scan::layout] [Parkitect] migrating legacy backup
[2024-06-11T20:48:58.504Z] INFO [ludusavi::scan::layout] [Parkitect] creating a Full backup: .
[2024-06-11T20:48:58.504Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Scenarios/workshop_files.dat", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Scenarios/workshop_files.dat", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/userdata/39075139/453090/remote/campaign", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/userdata/39075139/453090/remote/campaign", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/workshop_files.dat", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/workshop_files.dat", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Blueprints/workshop_files.dat", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Blueprints/workshop_files.dat", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/userdata/39075139/453090/remote/prgrs.ach", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/userdata/39075139/453090/remote/prgrs.ach", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/userdata/39075139/453090/remote/workshop_files.dat", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/userdata/39075139/453090/remote/workshop_files.dat", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/.sync", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/.sync", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.505Z] INFO [ludusavi::scan::layout] [Parkitect] backed up: StrictPath { raw: "/home/deck/.local/share/Steam/userdata/39075139/453090/remote/sync", basis: None } -> StrictPath { raw: "./drive-0/home/deck/.local/share/Steam/userdata/39075139/453090/remote/sync", basis: Some("/ludusavi-backup2/Parkitect") }
[2024-06-11T20:48:58.506Z] ERROR [ludusavi::path] [Parkitect] unable to copy: /home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial_ Loopy Lagoon.park -> ./drive-0/home/deck/.local/share/Steam/steamapps/common/Parkitect/Saves/Savegames/Tutorial_ Loopy Lagoon.park | No such file or directory (os error 2)
[2024-06-11T20:48:58.506Z] DEBUG [ludusavi::scan::layout] [Parkitect] Excess backups: [(0, None)]
[2024-06-11T20:48:58.506Z] INFO [ludusavi::cli] completed backup
mtkennerly commented 1 month ago

Thanks for the excellent bug report 🎉

I've added a fix in a4f74d38454bb9ced691ae3cbda07ddea63f0ebc. I'll try to make a new release for this within a week or so.

joelnb commented 1 month ago

Thanks for the quick response. I built the latest master and tested on my steam deck & can confirm it fixes the issue for me :+1: