docker-mc-backup
docker-mc-backup copied to clipboard
Unhandled restic repository state
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
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
Thanks! Any chance that this state could be detected and resolved automatically? I'm not sure if that would cause problems.
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.
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.