Repository navigation
fix(backups): unlock the repository after a restore - #61
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found after the unattended
--new-clusterrebuild of a live cluster. Every restore succeeded, but afterwards Nextcloud's backup failed on every run. It saved its snapshot, thenforgetfailed:The restore had left its restic lock behind, and restic doesn't take its exclusive
forgetlock while any lock exists. The ReplicationSource stayedFailed, andAppBackupOutOfSyncwould have fired.nixlab-restorenow sets the ReplicationSource'sspec.restic.unlock. That's VolSync's own mechanism: the next run doesrestic unlockfirst. Argo CD leaves the field alone, and the app stays Synced.Tests:
vm-app-backupsnow 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