Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent "Access is denied" on single file #431

Open
Terrance opened this issue Dec 19, 2024 · 2 comments
Open

Persistent "Access is denied" on single file #431

Terrance opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Terrance
Copy link

Ludusavi version

v0.27.0

Operating system

Windows

Installation method

Other

Description

The main save file of Human Resource Machine has been failing to backup for a while now, showing "Access is denied. (os error 5)" in the UI and CLI. Having now discovered the log files, this appears to be while setting a modified timestamp:

ERROR [ludusavi::path] [Human Resource Machine] unable to set modification time: C:/Users/User/AppData/Roaming/Human Resource Machine/profiles.bin -> backup-20241219T210959Z-diff/drive-C/Users/User/AppData/Roaming/Human Resource Machine/profiles.bin to SystemTime {
    intervals: 131803613301640108,
} | Access is denied. (os error 5)

With an existing game directory inside Ludusavi's target directory (containing only mapping.yml, no backups yet), a backup isn't created. After removing that directory and rerunning, a new mapping file and a complete backup was created, though the error was still logged and the CLI output still claimed it failed. Interestingly the timestamp of the affected file appears to be correct.

As far as I can tell, my user account has all the usual permissions to read and write that file, and the two files that form this game's complete save state (where the other is not reporting issues) both have all the same permissions.

(Installation method: Chocolatey)

Logs

📎 ludusavi_rCURRENT.log

$ ludusavi.exe backup 'Human Resource Machine'
Are you sure you want to proceed with the backup? New save data will be merged into the target folder:

Are you sure you want to proceed with the backup? New save data will be merged into the target folder:

D:/Saved Games/Ludusavi yes
Human Resource Machine [84 B] [Δ]:
  - [+] [FAILED] C:/Users/User/AppData/Roaming/Human Resource Machine/profiles.bin
    - Access is denied. (os error 5)
  - C:/Users/User/AppData/Roaming/Human Resource Machine/settings.txt

Overall:
  Games: 1 [Δ1]
  Size: 84 B / 14.30 MiB
  Location: D:/Saved Games/Ludusavi
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.
@Terrance Terrance added the bug Something isn't working label Dec 19, 2024
@mtkennerly
Copy link
Owner

Is the original file C:/Users/User/AppData/Roaming/Human Resource Machine/profiles.bin marked as read-only? I wasn't able to reproduce this at first with a brand new save file, but when I manually mark the file as read-only, then I can reproduce this behavior. If it's the same on your end, then I should be able to fix this.

@Terrance
Copy link
Author

You're right -- I'd missed that! Wonder why it was marked read-only in the first place. Unset the read-only bit and we're good:

Human Resource Machine [14.30 MiB] [Δ]:
  - [+] C:/Users/User/AppData/Roaming/Human Resource Machine/profiles.bin
  - C:/Users/User/AppData/Roaming/Human Resource Machine/settings.txt

Overall:
  Games: 1 [Δ1]
  Size: 14.30 MiB
  Location: D:/Saved Games/Ludusavi

I suppose it would be nice to have some handling for this: either to ignore the setting of mtimes if it fails (not sure if there's a way to produce non-fatal warnings currently), or to fiddle with the read-only bit in order to do what's needed before putting it back (or not -- probably not too fussed if backups lose read-only state, I'd rather the timestamps be correct).

@mtkennerly mtkennerly added this to the v0.28.0 milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants