docker-mc-backup icon indicating copy to clipboard operation
docker-mc-backup copied to clipboard

Unhandled restic repository state

Open Fysac opened this issue 3 years ago • 4 comments

I'm getting these errors that are blocking backups from happening; something to do with a stale lock not getting cleaned up?

backups    | 2021-12-31T17:47:58+0000 ERROR unable to create lock in backend: repository is already locked exclusively by PID 29 on backups by root (UID 0, GID 0)
backups    | 2021-12-31T17:47:58+0000 ERROR lock was created at 2021-12-17 22:29:45 (331h18m12.754164122s ago)
backups    | 2021-12-31T17:47:58+0000 ERROR storage ID dda39961
backups    | 2021-12-31T17:47:58+0000 ERROR the `unlock` command can be used to remove stale locks
backups    | 2021-12-31T17:47:58+0000 INTERNALERROR Unhandled restic repository state.
backups    | 2021-12-31T17:47:58+0000 INTERNALERROR Please report this: https://github.com/itzg/docker-mc-backup/issues
backups exited with code 2

Fysac avatar Dec 31 '21 17:12 Fysac

This Discord message is what was found to resolve this scenario. If using a compose file, the command from there is:

docker-compose run -e XDG_CONFIG_HOME=/config --entrypoint restic <compose service> -r <restic repo> unlock

itzg avatar Jan 01 '22 18:01 itzg

Thanks! Any chance that this state could be detected and resolved automatically? I'm not sure if that would cause problems.

Fysac avatar Jan 02 '22 21:01 Fysac

That seems tricky to detect and risky to automate. It does seem like something that could be added to the README, since you're now the second person to encounter this.

itzg avatar Jan 02 '22 21:01 itzg

Absent trying to detect it, is there a way to ensure it doesn't happen in the first place, perhaps by waiting for all running restic processes to exit when the container is gracefully shut down? I haven't looked too deeply at the implementation, so forgive me if what I'm saying doesn't make sense.

If nothing can be done about it for now, I think it's worthwhile to note it in the README as a known issue.

Fysac avatar Jan 02 '22 21:01 Fysac