From 6ea9862c147fa6dc52dfcef0ccf624e4425427c0 Mon Sep 17 00:00:00 2001 From: Chuck Date: Thu, 11 Jun 2026 09:42:49 -0400 Subject: [PATCH] fix(install): don't let outer ERR trap mask first_time_install.sh failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set +e alone doesn't suppress bash's ERR trap, so any non-zero exit from first_time_install.sh inside the one-shot installer immediately triggered the outer on_error handler with a generic "Main installation, line 370" message — before the script could report the real exit code or point to logs/. Suspend the trap for that block so the existing if/else handling runs instead. --- scripts/install/one-shot-install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/install/one-shot-install.sh b/scripts/install/one-shot-install.sh index ddac1115..472b687f 100755 --- a/scripts/install/one-shot-install.sh +++ b/scripts/install/one-shot-install.sh @@ -340,9 +340,14 @@ main() { echo "" # Execute with proper error handling and non-interactive mode - # Temporarily disable errexit to capture exit code instead of exiting immediately + # Temporarily disable errexit AND the ERR trap to capture exit code instead of + # exiting immediately. `set +e` alone does not suppress the ERR trap, so without + # `trap '' ERR` a non-zero exit from first_time_install.sh would trigger on_error + # here with the generic "Main installation" message instead of the detailed + # if/else handling below. set +e - + trap '' ERR + # Check /tmp permissions - only fix if actually wrong (common in automated scenarios) # When running manually, /tmp usually has correct permissions (1777) TMP_PERMS=$(stat -c '%a' /tmp 2>/dev/null || echo "unknown") @@ -370,6 +375,7 @@ main() { sudo -E env TMPDIR=/tmp LEDMATRIX_ASSUME_YES=1 bash ./first_time_install.sh -y