Silent installer abort right after first whiptail dialog (set -e + AND-list) #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Reported on real PVE host 2026-05-19 by operator: after running
the script presents the early dialogs correctly, but the moment
default_settings()is meant to run, it silently returns to the shell. No error message visible. Behaviour identical for sidecar and all-in-one.advanced_settings()is never reached either, so it's something insidedefault_settings()— but no output makes it to the terminal.Root cause
misc/build.func:220ended with…as the last statement of
default_settings(). The script runs withset -euo pipefail(misc/build.func:12). On a real PVE hostpvesm status -content rootdiralways returns at least one storage, soSTORAGEis already non-empty when this line runs:[ -z "$STORAGE" ]→ exits 1&&-compound short-circuits → exit 1start()is a "simple command" — no&&/||/ifexception applies — soset -efiresmsg_error, callsexit 1So: silent abort, no diagnostic, exact same UX whichever scope was picked. Sources confirming the
set -emechanics: GNU Bash manual — Set Builtin, BashFAQ/105.A latent sibling bug in
list_bridges()Same class, different mechanism.
misc/build.func:117-125had:If
interfaces.d/is empty (true on a fresh PVE install), the glob stays literal →[ -f ]returns 1 → for-loop exits 1 →{ … } | sort -uwithpipefailpropagates exit 1 →$(list_bridges | paste …)inbuild_container's pre-flight kills the script before any whiptail dialog runs. Wasn't the cause of the reported symptom (the operator saw whiptails first), but would have surfaced as a near-identical silent abort on another machine.Fixes
Commit
34d5028—fix(build.func): silent abort after first dialog (set -e + AND-list):default_settings()(misc/build.func:219-227): replaced[ -z ] && var=…with two${VAR:-…}parameter-expansions which can never propagate a test-style exit code.list_bridges()(misc/build.func:117-130):shopt -s nullglobaround the loop + explicitreturn 0._on_err, misc/build.func:65-100): resets terminal (stty sane,tput rmcup,tput sgr0) before printing, so the alt-screen repaint can no longer eat the error. Dumps failing$BASH_COMMAND,FUNCNAME/BASH_LINENOstack trace, and the xtrace-log path.catch_errorsaddsset -Eso the trap propagates into functions.DEBUG=1env-flag: fullbash -xxtrace to/tmp/teddytafforge-trace-<pid>.logon a dedicated FD (whiptail's stdio juggling can't corrupt it) + human-readabledbg "msg"checkpoints at every meaningful state transition. Forwarded into the LXC viapct execenv. Marked TEMP in the source — to be removed after real-hardware validation.CHANGELOG-Unreleased and README updated (new "Debug mode" section + troubleshooting row).
Verification
Commit
5e4900d—test(dry): full {scope × settings} matrix dry-test under scripts/dry-test/:The existing CI smoke test only walks one path (sidecar + defaults) and was green throughout the bug's lifetime — because that path also worked before the fix (it was the real-PVE path that broke, where
pvesmreturns a storage name).New
scripts/dry-test/matrix.shwalks all four combos with title-aware whiptail mocks, real FD convention, and forwards the samepvesmoutput a real host would return:Each run exercises
start() → default_settings → (optionally) advanced_settings → build_container (pre-flight + ensure_template + pct create) → description()end-to-end underDRY_RUN=1. Confirmed:default_settings()now completes cleanly with pre-setSTORAGE(the formerly-crashing path) —dbgshowsSTORAGE=local-lvm BRG=vmbr0 NET=dhcpafter the function returnsadvanced_settings()walks all 13 dialogs (CTID/Hostname/Storage/Disk/CPU/RAM/IPv4/MAC/VLAN/MTU/SSH-Key/IPv6/Verbose) and returns cleanbuild_containerpre-flight (bridge_exists/storage_existsinside command-substitution with pipefail) doesn't crash on emptyinterfaces.d/pct createarg-vector composed correctly (DRY-Run log nachvollziehbar)description()returns clean even without an IPWhat's NOT covered by the dry test
pct create/ template download / LXC startteddytafforge-install.sh/all-in-one-install.sh/teddycloud-install.sh)pct exec ... bash -c "curl ... | bash"chainOperator should re-run with
DEBUG=1on the actual PVE host. If anything new crashes, the improved ERR-handler will surface the failing command, the call stack, and the xtrace-log path — enough to diagnose without round-trips.References
34d50285e4900dbash-set-e-andlist-lastlinebash-nullglob-pipefail-trapwhiptail-alt-screen-error-eatenClosing as fixed; will re-open or file follow-up if real-PVE test reveals additional issues.