Skip to content

Explain snapshot failures caused by regular directories - #11287

Open
hussainanjar wants to merge 1 commit into
omacom:quattrofrom
hussainanjar:fix/11100-snapshot-diagnostic
Open

hussainanjar wants to merge 1 commit into
omacom:quattrofrom
hussainanjar:fix/11100-snapshot-diagnostic

Conversation

@hussainanjar

Copy link
Copy Markdown

When a backup restore leaves .snapshots as a regular directory, omarchy snapshot create stops with Snapper's opaque Btrfs error. Add guidance to locate the affected config's subvolume, preserve the directory's contents, and recreate it as a Btrfs subvolume before retrying.

Keep the original error and exit status, skip cleanup after failed creation, and leave unrelated failures without subvolume repair advice.

Fixes #11100.

Validation:

  • Snapshot regression tests pass for root and non-root configs, original exit status, cleanup suppression, and unrelated failures. The new test failed before the fix.
  • ./test/cli, Bash syntax checks, and git diff --check pass.
  • Ran ./test/all (236 shell test files). Five environment/artifact failures passed on focused reruns after supplying the omarchy-pkgs and omarchy-iso checkouts, unsetting NO_COLOR, and removing generated Python bytecode.
  • runtime-smoke-test.sh fails its duplicate IPC-handler check on this two-monitor session. The same check also fails on a clean upstream quattro checkout at b5589faa.

@johnpippett johnpippett left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend this change based on the automated checks below. This review used Codex assistance.

The change adds guidance when Snapper reports that .snapshots is not a Btrfs subvolume. It keeps the original error and exit status. It does not start cleanup for the failed configuration.

Source commit: 880b84b580ee5b64ee3f36b0a416c1a81d8f6211.
Base commit: b5589faaf80c6f87c07d4560fca37c4a81722f28.

The earlier CLI suite, focused snapshot suite, and Bash syntax checks returned status 0 on both commits. All 22 independent test cases gave the expected results: 11 cases per commit. These included unrelated errors, missing Snapper, multiple configurations, and a failed configuration-list command.

The tests used the real snapshot script with a Snapper substitute. Private Bubblewrap namespaces kept the source read-only and excluded the host desktop and network.

The full shell suite did not complete because the test environment lacked dependencies. No real Btrfs volume or snapshot operation was used. A failed configuration-list command produces the same existing misleading message on both commits.

Before submission, the source and base commits still matched these results. The tests were not repeated for this submission.

@chessing234

Copy link
Copy Markdown
Contributor

@dhh @omarchybot the directory explanation from this PR is in #21027.

omarchy-snapshot create still prints the snapper number (-p) and stores it for the systemd-boot boot-entry check. stderr goes to a temp file, so a .snapshots is not a btrfs subvolume failure prints the recovery steps and exits with snapper's status. cleanup number does not run after that failure. snapshot-create-test.sh covers both the directory case and the boot entry.

Please consider closing this as superseded only after #21027 is accepted. Leaving the close to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-snapshot: handle non-subvolume /.snapshots with clear diagnostic and recovery instructions

4 participants