Skip to content

Omarchy 'omarchy update' #8239

Open

Description

@helioryn

System details

omarchy update crash — HP ProBook 450 G7 (Intel i3-10110U, x86_64, kernel 7.1.9)

Date: 2026-08-25 08:33:38

[1] Versions
omarchy 4.0.1-1
linux 7.1.9.arch1-2
kernel running: 7.1.8-arch1-3

[2] Is OMARCHY_PATH present in a normal (non-sudo) shell?
OMARCHY_PATH=/usr/share/omarchy
-> Under 'sudo' (default env_reset) sudo strips env vars it does not
whitelist, so OMARCHY_PATH is normally REMOVED for the update.

[3] Reproduce the crash: run the dev-check WITHOUT OMARCHY_PATH (as sudo does)
/usr/bin/omarchy-update-dev: line 7: OMARCHY_PATH: unbound variable
(exit above is from the crashed dev-check)
Expected output: /usr/bin/omarchy-update-dev: line 7: OMARCHY_PATH: unbound variable

[4] The buggy script (line 7 + set -u will crash on unbound OMARCHY_PATH)
1 #!/bin/bash
2
3 # omarchy:summary=Update the active Omarchy dev checkout
4
5 set -euo pipefail
6
7 [[ $OMARCHY_PATH != "/usr/share/omarchy" ]] || exit 0
8
9 if ! git -C "$OMARCHY_PATH" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
10 echo "Error: OMARCHY_PATH is not a git checkout: $OMARCHY_PATH" >&2
11 exit 1
12 fi
13
14 upstream=$(git -C "$OMARCHY_PATH" rev-parse --abbrev-ref --symbolic-full-name '@{upstream}' 2>/dev/null || true)

[5] Confirm the fix: set OMARCHY_PATH and re-run (stock install should no-op)
exit=0 (exit 0 = check bypassed successfully)

[6] sudo env_keep: is OMARCHY_PATH whitelisted for sudo?
secure_path=/usr/local/sbin:/usr/local/bin:/usr/bin, passwd_tries=10
Run as and Command-specific defaults for root:
Defaults!/usr/bin/visudo env_keep+="SUDO_EDITOR EDITOR VISUAL"

    "omarchy update fails: OMARCHY_PATH: unbound variable (set -u + sudo env_reset)"

Activity

  1. omarchybot commented on Oct 9, 2026

    @omarchybot
    Collaborator

    Thanks for the detailed report. The crash is real on 4.0.1 through 4.0.4, and an open pull request already fixes it: #14337.

    What happens: omarchy update doesn't strip OMARCHY_PATH itself. It inherits it from the session, where default/bash/env-bootstrap exports it for login shells, Bash and the Hyprland session through uwsm. Your step [2] shows it set in a normal shell. It goes missing when the update is started from an environment that drops it, such as sudo omarchy update or pkexec omarchy-update. omarchy-update-dev then reads it under set -u on line 7 and aborts. Running omarchy update as your own user, without sudo, avoids it on the current release. The update asks for sudo itself when it needs it.

    On quattro: since f37c73f, omarchy update stops at its entry point with OMARCHY_PATH does not match this Omarchy command. before it reaches omarchy-update-dev. The unbound-variable crash is no longer reachable through the update, but an update started without OMARCHY_PATH still refuses to run.

    Reproduced on a worker built from the Omarchy ISO (omarchy 4.0.4). Run on quattro with OMARCHY_PATH unset, omarchy-update-dev fails with line 7: OMARCHY_PATH: unbound variable, and omarchy-update refuses at the source-root check. With #14337's head (57621d6), omarchy-update-dev exits 0, and test/shell.d/update-dev-test.sh passes 7/7.

    Fix: #14337 defaults OMARCHY_PATH to /usr/share/omarchy in omarchy-update-dev, and in omarchy-update before the source-root check. A non-empty value still has to match the command being run. That PR doesn't link this issue yet; omabot declined to add the link until #14337 has been reviewed as a fix itself. #12858 reports the same crash on 4.0.4.

    Second opinion: Codex Medium reviewed the same code and agreed on the mechanism, but its independence from this review isn't guaranteed. It also pointed out something #14337 doesn't settle: a root-launched update gets past the guard, but migrations and mise would still run as root against the user's home (#13329). Whether the update should support being started as root is a decision for the maintainer.

    This now waits on the maintainer's decision on #14337.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions