omarchy update fails at migration 1787515927 on every retry (Bash 5.3 EXIT trap returns 1)
The mechanism is right in every detail and I confirmed the two named anchors plus the bash behaviour directly on this machine. Confirmed locally on omarchy 4.0.2-1 with bash 5.3.15-1: cleanup() starts at line 82 of /usr/bin/omarchy-theme-set-browser-policy and is an if block, and the script even carries the comment 'Bash 5.3 makes the EXIT trap's last command decide the script's exit status, so this handler must not end on a false test.' Line 16 of /usr/share/omarchy/migrations/1787515927.sh is omarchy-theme-set-browser || true, guarded by if (( repaired )). I ran the minimal reproduction from the cause and it returns 1, and the if form of the same handler returns 0, so the Bash 5.3 claim is exercised here and not taken on trust. Also confirmed locally: /usr/bin/omarchy-theme-set-browser takes no argument, calls the policy script with the theme hex and ends on exit "$failed", the helper's BROWSER_POLICY_FIREFOX_DIRS is exactly /usr/lib/firefox/distribution and /opt/zen-browser/distribution, /usr/bin/omarchy-theme-set has no set -e and calls omarchy-theme-set-browser at line 329, omarchy-migrate --pending exists, and the marker path ~/.local/state/omarchy/migrations/1787515927.sh is real and already present here. Confirmed from upstream: the v4.0.1 tree has no migrations/1787515927.sh at all, and the v4.0.2 tree already has the if handler at line 82 and the || true call, so 'v4.0.1 never shipped it and v4.0.2 shipped it fixed' holds. Commit 62eb5182d073191e62bee137bf8e2521414445cc is the merge of PR #8835 dated 2026-08-29T01:24:32Z and touches exactly bin/omarchy-theme-set-browser-policy, migrations/1787515927.sh and test/shell.d/browser-policy-dir-test.sh. Issue #8833 carries the same diagnosis, the same minimal reproduction and the sudo -n reproduction the record quotes. Issue #8832 is the original report and #8835 says 'Fixes #8832. Root cause diagnosed in #8833.' The second-reporter claim holds: jasonfried on #8833 reproduced it on a machine where both loops were no-ops, which is what rules out a permissions edge case. The interactive-sourcing warning holds: avenkidur sourced the migration and saw 'command not found: as_root', and jasonfried explained why that is an artefact of the interactive shell. The edge confirmation holds: avenkidur wrote 'I was able to do nothing and let a subsequent update run' and reported Chromium and /opt/zen-browser-bin/distribution at 0755 afterwards.
Two defects. First, the verify block's third line is wrong and I proved it here. omarchy-theme-set-browser-policy; echo "exit=$?" passes no argument, and the script starts with if (( $# != 1 )); then usage; exit 1; fi, so it prints its usage line and returns 1 on the fixed script too. Running it on this machine gave exit=1. The correct argument-free caller is omarchy-theme-set-browser, which is also the command the migration invokes. Second, open question Q5 is answerable, and both source records were half right, so the symptom's 'source-checkout builds' framing is wrong on its own. In #8832 avenkidur's System details say 'Omarchy Quattro Edge', but their own trace resolves $OMARCHY_PATH to /home/jon/omarchy and sources /home/jon/omarchy/install/helpers/browser-policy.sh, which is the dev-channel linked checkout rather than edge. In #8833 jasonfried gives omarchy 4.0.0.r1872.g7d58bb9-1, quotes /usr/bin/omarchy-theme-set-browser-policy and says the quattro copy is byte-identical to the installed one, which is the edge omarchy-dev package with no checkout. So one reporter was on dev and one was on edge. The date window is also off: the migration's epoch-derived id is 2026-08-23 20:12 UTC, but the file reached quattro on 2026-08-24 and the failing staged trap was only introduced on 2026-08-25T19:01:01Z by commit bafc9a1000 and fixed on 2026-08-28T23:00:03Z by commit 5925929cb6, merged 2026-08-29. Both issues were filed on 2026-08-28.
Not exercised: I did not run omarchy update, omarchy-migrate, omarchy-theme-set-browser or the policy script with a colour argument, since all of those write to /etc and I have no sudo. The marker-file workaround and the post-fix update rest on #8832 and #8833, not on me. The migration has already run on this machine, so I could not observe the failure itself.
The marker-file workaround skips the migration that hardens world-writable browser policy directories. Check those directory modes first, and delete the marker later so the migration runs for real.
Symptom
omarchy update aborts at the same migration on every retry, with nothing between the banner and the failure:
Running migration (1787515927)
Stop world-writable Chromium and Firefox policy directories
Something went wrong during the update!
Please review the output above carefully, correct the error, and retry the update.
/tmp/omarchy-update.log shows no error between the migration banner and the failure. Run on its own, the policy script writes the correct file and still reports failure:
$ sudo -n /usr/bin/omarchy-theme-set-browser-policy 060b1e; echo "exit=$?"
exit=1
$ cat /etc/chromium/policies/managed/color.json
{"BrowserThemeColor": "#060b1e", "BrowserColorScheme": "device"}
Both reports were filed on 2026-08-28 against omarchy-dev builds with bash 5.3.15-1. One reporter was on the dev channel, where $OMARCHY_PATH points at a linked ~/omarchy checkout. The other was on the edge channel, running the packaged omarchy 4.0.0.r1872.g7d58bb9-1 out of /usr/bin with no checkout. Stable 4.0.1 never shipped this migration and stable 4.0.2 shipped it already fixed, so only dev and edge installs between 2026-08-25 and 2026-08-29 could hit it.
Cause
The migration is fine. It calls omarchy-theme-set-browser, which runs omarchy-theme-set-browser-policy, and that script's EXIT trap was:
cleanup() { [[ -n $staged ]] && rm -f "$staged"; }
staged is cleared after each policy file is written, so on every successful run the test is false, the && list short-circuits, and the handler's last status is 1. Bash 5.3 makes the exit status of the EXIT trap the script's exit status, where 5.2 did not, so exit "$failed" with failed=0 became exit 1. The migration runs under bash -euo pipefail, aborts between its Chromium loop and its Firefox loop, and omarchy-migrate never writes its completion marker, which is why every retry fails identically and why the Firefox hardening never ran. Theme switching was unaffected because omarchy-theme-set does not run under set -e.
Minimal reproduction, no Omarchy needed:
$ bash -c 'set -euo pipefail; staged=""; cleanup(){ [[ -n $staged ]] && rm -f "$staged"; }; trap cleanup EXIT; exit 0'; echo $?
1
A second reporter reproduced it on a machine where the migration had nothing to harden, which isolates it to the exit status and rules out a permissions edge case. The bad trap entered quattro on 2026-08-25 in commit bafc9a1000, which moved the colour write behind a passwordless helper. It was fixed in PR #8835, merged 2026-08-29 as commit 62eb5182: the trap became an if block, and the migration now calls omarchy-theme-set-browser || true so a cosmetic repaint cannot block the Firefox hardening after it. Confirmed on an omarchy 4.0.2-1 install and at the v4.0.2 tag: cleanup() at line 82 of /usr/bin/omarchy-theme-set-browser-policy is an if block, and line 16 of the migration ends in || true.
Fix
**Omarchy 4.** Update to a build that carries commit 62eb5182. v4.0.2 and later do:
omarchy update
One reporter on edge did nothing else and the next omarchy update, after the fix had landed, ran the migration through and left /etc/chromium/policies/managed and /opt/zen-browser-bin/distribution at 0755.
**Stuck on a build before the fix.** Confirm it is this defect and not a real policy write failure:
omarchy-theme-set-browser; echo "exit=$?" # exit=1 with a correct file below is this bug
cat /etc/chromium/policies/managed/color.json
bash -c 'set -euo pipefail; staged=""; cleanup(){ [[ -n $staged ]] && rm -f "$staged"; }; trap cleanup EXIT; exit 0'; echo $?
If the update itself is blocked and you cannot pull a fixed package, a reporter's workaround writes the migration's marker so it is skipped. Check first that the directories it hardens are already correct, because the marker stops the migration from ever running:
stat -c '%a %U:%G %n' /etc/chromium/policies/managed /opt/zen-browser/distribution /usr/lib/firefox/distribution 2>/dev/null
touch ~/.local/state/omarchy/migrations/1787515927.sh
omarchy-migrate --pending # should print nothing
omarchy update
Delete that marker once a fixed package is installed if you want the migration to run for real. Do not source the migration into an interactive shell to debug it: one reporter did and saw command not found: as_root, which was an artefact of the interactive shell rather than the cause.
Verify
grep -n -A3 '^cleanup()' /usr/bin/omarchy-theme-set-browser-policy # an if block, not && rm
grep -n 'theme-set-browser' /usr/share/omarchy/migrations/1787515927.sh # ends in || true
omarchy-theme-set-browser; echo "exit=$?" # exit=0 on the fixed script
omarchy-migrate --pending # empty after a successful update
stat -c '%a %U' /etc/chromium/policies/managed /opt/zen-browser/distribution 2>/dev/null
Use omarchy-theme-set-browser and not omarchy-theme-set-browser-policy for the exit-status check. The policy script requires a six hex digit colour argument and prints its usage line and returns 1 without one, on the fixed script as well, so a bare call proves nothing.
Sources
- https://github.com/omacom/omarchy/issues/8832
- https://github.com/omacom/omarchy/issues/8833
- https://github.com/omacom/omarchy/pull/8835
- https://github.com/omacom/omarchy/commit/62eb5182d073191e62bee137bf8e2521414445cc
- https://github.com/omacom/omarchy/releases/tag/v4.0.2
- https://github.com/omacom/omarchy/commit/bafc9a1000
- https://github.com/omacom/omarchy/commit/5925929cb6
- https://github.com/omacom/omarchy/blob/v4.0.2/bin/omarchy-theme-set-browser-policy
- https://github.com/omacom/omarchy/blob/v4.0.2/migrations/1787515927.sh