Commit 9ea00d8
fix(v1.100.2): SF-1 — nftban health prints "ERROR: Script failed" on released host (#504)
Side finding SF-1 from PR-24 7-day passive soak (Day 6, 2026-04-26
on lab4 / AuthorityNone): `nftban health` rendered a spurious
"ERROR: Script failed" block on top of its own DOWN-status table.
Root cause: 4 unprotected call sites under set -Eeuo pipefail.
nftban_health_cmd_truth() correctly captures the validator's exit
code (2) internally and renders a clean DOWN table, but the bare
invocations at the case-branch / dispatcher / top-level main
fire the ERR trap defined in lib/strict.sh before the function's
exit code can propagate cleanly.
Fix: add `cmd || return $?` (or `|| exit $?` at top level) at:
- cli/lib/nftban/cli/cmd_health.sh:140 — case check|""|truth|axes
- cli/lib/nftban/cli/cmd_health.sh:189 — case json|--json
- cli/sbin/nftban:917 — main() dispatch into nftban_cmd_<X>
- cli/sbin/nftban:1261 — top-level `main "$@"` invocation
The pattern is already documented inside nftban_health_cmd_truth
itself (lines 413-421) for the same reason on the inner validator
call. Exit-code semantics preserved: a released host now exits 2
cleanly, matching the rendered DOWN status, with no spurious trap
output.
Verified by local bash simulation: old pattern fires TRAP-FIRED
on validator exit 2; new pattern propagates exit 2 cleanly with no
trap output.
Out of scope (locked):
- Lifecycle execution surfaces untouched (restore/, state/file.go,
uninstall_apply.go, etc.)
- SF-2 stale FAILURE_REASON retained in state file — separate fix
- Repo hygiene Phase A — separate (1.100.3+)
- Lifecycle completion lane (PR-25..PR-30) — explicitly OPEN
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cc4cf10 commit 9ea00d8
3 files changed
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
14 | 46 | | |
15 | 47 | | |
16 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
| |||
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
189 | | - | |
| 195 | + | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
917 | | - | |
918 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
919 | 924 | | |
920 | 925 | | |
921 | 926 | | |
| |||
1253 | 1258 | | |
1254 | 1259 | | |
1255 | 1260 | | |
1256 | | - | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
0 commit comments