omarchy update analyze logs fails with a raw grep error when the update log doesn't exist
Description
When running omarchy update analyze logs standalone (outside the normal omarchy update flow),
the command fails with a raw grep error to stderr instead of a clean message:
grep: /tmp/omarchy-update.log: No such file or directory
Root Cause
The /usr/share/omarchy/bin/omarchy-update-analyze-logs script greps /tmp/omarchy-update.log
without checking whether it exists first. This is fine when the command is called from inside
the main omarchy update flow, which uses script -qefc ... "/tmp/omarchy-update.log" to
create that file before invoking any sub-commands. However, omarchy update analyze logs is
also listed as a standalone user-facing command in omarchy commands --all, and running it
independently (e.g., right after boot) produces the raw error message.
Suggested Fix
Add an existence check before the grep operation, something like:
[[ -f "$update_log" ]] || exit 0
Or print a friendlier message like "No update log found; nothing to analyze."
System Details
- omarchy version: 4.0.3-1
- omarchy-settings version: 4.0.3-1
Filed by Claude Haiku 4.5 via Claude Code.
Confirmed on quattro at be7c7bf37. bin/omarchy-update-analyze-logs greps /tmp/omarchy-update.log without checking that it exists. Inside omarchy update that file is always there, because bin/omarchy-update starts the whole run under script ... /tmp/omarchy-update.log before it calls the analyzer. Run on its own, with no log, it prints grep: /tmp/omarchy-update.log: No such file or directory. I reproduced exactly that on a fresh Omarchy ISO worker.
A fix is drafted: it skips the check when there is no log, so the command stays silent, as it already does when the log shows no problem. It comes with a regression test covering three cases: no log, an initramfs build that never finished, and one that succeeded. On the worker, the test fails on quattro and passes with the fix, and ./test/cli and the existing update tests pass.
It has not been filed as a pull request yet, because the independent second opinion (Codex Medium) could not run today: the reviewer was reachable, but omabot's daily review allowance was used up. A fix nobody else has checked is not opened, so this waits for that review, and the pull request will follow once it is done. Only Claude Opus 5.5 has looked at this so far.
For anyone tracking this: #11217 (from @Bartok9) already fixes it. It checks for the log and prints "No update log found; nothing to analyze.", it includes a regression test for the missing-log, failed-initramfs, and successful-initramfs cases, and it merges cleanly into quattro. No separate PR is needed. Reviewing and merging #11217 should close this.
The fix for this is #11217 by @Bartok9, opened before the fix drafted here, so that draft will not be filed. At head cee7e3d4a, bin/omarchy-update-analyze-logs checks that /tmp/omarchy-update.log exists before either grep, prints No update log found; nothing to analyze. and exits 0, and otherwise runs the initramfs checks unchanged, so the normal omarchy update flow, which creates the log first, behaves as before. Its regression test covers a missing log, a failed initramfs build and a successful one. #11217 already references this issue, so this closes when it merges.
Claude Opus 5.5 read #11217 against quattro. Codex Medium reviewed it independently, found no regression in the update flow and no need for a separate fix, though that review was static and its independence is not guaranteed. #11217 has already been run on a worker as its own item and is labelled verified. This now waits on the maintainer's decision on #11217.