omarchy update aborts on a root-owned user config directory, with no guidance on how to recover
Summary
When a migration cannot write a user config file because the destination directory is owned by root, omarchy update aborts with a bare cp: cannot create regular file …: Permission denied. The message names neither the cause (ownership) nor the fix (a chown), and because omarchy-migrate runs every migration with bash -euo pipefail, the failure stops the update and leaves every following migration pending — the machine stays in a failing-update loop until the user works out the chown by hand.
What happened
omarchy update (run as the normal user, from the Omarchy menu) stopped at the first pending migration:
Running migration (1789130779)
Keep the KEF LSX II LT USB sink from suspending
cp: cannot create regular file '/home/<user>/.config/wireplumber/wireplumber.conf.d/kef-lsx-no-suspend.conf': Permission denied
Something went wrong during the update!
Please review the output above carefully, correct the error, and retry the update.
The migration is:
# /usr/share/omarchy/migrations/1789130779.sh
conf="wireplumber/wireplumber.conf.d/kef-lsx-no-suspend.conf"
if [[ ! -f "$HOME/.config/$conf" ]]; then
omarchy-refresh-config "$conf"
…
fi
and omarchy-refresh-config ends in a plain copy:
mkdir -p "$(dirname "$user_config_file")"
…
cp -f "$default_config_file" "$user_config_file"
The destination directory was owned by root:
drwxr-xr-x root root /home/<user>/.config/wireplumber
drwxr-xr-x root root /home/<user>/.config/wireplumber/wireplumber.conf.d
So the cp failed with EACCES, and omarchy-migrate aborted the whole update:
# /usr/share/omarchy/bin/omarchy-migrate
OMARCHY_PATH="$OMARCHY_PATH" bash -euo pipefail "$file" 3<&-
Because the marker for the migration is only written after it succeeds, the migration stays pending and the update keeps failing the same way on every retry.
Why this is worth fixing
The root-owned directory was a leftover from an earlier elevated run (see #13329 for how those get created). The user did nothing wrong, and the failure mode is:
- the update cannot complete at all, and
- the only hint is a
cperror that says nothing about ownership.
A migration that hits a root-owned directory in the user's own home is a known, recoverable state — it should not be a dead end.
Suggested fix (any of)
-
Actionable message — when the destination directory is not writable,
omarchy-refresh-config(or the migration) could print the exact command to run, e.g./home/<user>/.config/wireplumber is owned by root; run: sudo chown -R $USER:$USER /home/<user>/.config/wireplumber -
Auto-repair — a migration that writes inside
$HOMEcould correct ownership of the directory it is about to write into when that directory is owned byrootand lives inside the user's own home (a conservative variant: only when the path is under$XDG_CONFIG_HOME/$HOMEand is a directory, not a symlink). -
Non-fatal migration —
omarchy-migratecould treat an individual migration failure as a warning, report the failures at the end, and still run the remaining migrations, instead of aborting the whole update. See #11257 for the same class of failure.
Reproduction
mkdir -p ~/.config/wireplumber
sudo chown root:root ~/.config/wireplumber
omarchy update
System
- Omarchy: 4.0.6-1
- Kernel: 7.2.8-9-omarchy
- Migration:
1789130779.sh(omarchy-refresh-config wireplumber/wireplumber.conf.d/kef-lsx-no-suspend.conf)
Thanks for the detailed report. I read it, along with #13329 and #11257, and searched the open issues for one asking for the same change; I found none, so this is not a duplicate.
I have not labelled it, because the two models that classified it disagree. I (Claude Opus 5.5) read it as an enhancement: the migration and omarchy-migrate behave as written, the root-owned directory comes from an elevated run, which #13329 already tracks as a bug, and each of the three suggestions — an actionable message, repairing ownership, carrying on past a failed migration — is new behaviour. Codex at medium effort, deciding separately, read it as a bug. Nothing was run on a worker, since what happens next turns on that answer.
This now waits on a maintainer to say which it is.
Same root cause as #13329, one layer up: a sudo-run update writes mise state as root, and the next unprivileged run cannot write there. On 4.5.0-3 the abort is deterministic once any file in a user config directory is root-owned. The message reports the path and the permission error but names neither the cause (an earlier escalated run left it root-owned) nor the fix, which is repair ownership, not delete the directory.
PR #16290's shape is right: name the owner and the command that created it, then say what to run. Two follow-ons need the same treatment for the message to be truthful. The update lock ($XDG_RUNTIME_DIR/omarchy-update.lock) is left root-owned too, and a root-owned lock makes the retry fail on a different error before it reaches the config directory; the update log is the third.
Repair is the chown, per #13329. Recovery is ownership, not a rebuild:
find $HOME/.cache/mise $HOME/.local/share/mise -not -user "$(id -u)" -print0 \
| xargs -0 sudo chown -h "$(id -u):$(id -g)"
Verified on 4.5.0-3: 0 paths not owned by the user afterwards and the abort does not recur. The underlying fix belongs with the sudo annotation in #13329; this is the symptom that makes it visible.