Skip to content

fix(backups): unlock the repository after a restore - #61

Merged
thatbagu merged 1 commit into
mainfrom
fix/restore-stale-lock
Nov 20, 2026
Merged

thatbagu merged 1 commit into
mainfrom
fix/restore-stale-lock

Conversation

@thatbagu

Copy link
Copy Markdown
Owner

Found after the unattended --new-cluster rebuild of a live cluster. Every restore succeeded, but afterwards Nextcloud's backup failed on every run. It saved its snapshot, then forget failed:

unable to create lock in backend: repository is already locked by PID 104 on volsync-dst-restore-nextcloud-nextcloud-… (1h41m ago)

The restore had left its restic lock behind, and restic doesn't take its exclusive forget lock while any lock exists. The ReplicationSource stayed Failed, and AppBackupOutOfSync would have fired.

nixlab-restore now sets the ReplicationSource's spec.restic.unlock. That's VolSync's own mechanism: the next run does restic unlock first. Argo CD leaves the field alone, and the app stays Synced.

Tests: vm-app-backups now checks that the unlock is scheduled after a restore and that the next backup succeeds and records it. It fails without the fix.

Live: the same unlock cleared the stuck repository; Nextcloud's backup succeeded again.

🤖 Generated with Claude Code

A restore can leave its restic lock in the repository. Every later backup
then saved its snapshot but failed at "forget" ("repository is already
locked"): on a live cluster, Nextcloud's backup errored on every run
after a --new-cluster rebuild, and its ReplicationSource stayed Failed.
nixlab-restore now sets the ReplicationSource's restic.unlock, so the
next run unlocks first (VolSync's own mechanism; Argo CD leaves it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thatbagu
thatbagu merged commit bdb9ef9 into main Nov 20, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant