Problem
scripts/healthcheck.sh aborts after the first pass or fail call, reporting only one check instead of all five.
$ scripts/healthcheck.sh --version 0.35.1rc5
Checking service: untether.service
---
OK: service is active
$ echo $?
1
Root cause
The script runs under set -euo pipefail. Both counter helpers use post-increment arithmetic:
pass() { echo "OK: $1"; ((CHECKS_PASSED++)); }
fail() { echo "FAIL: $1"; ((CHECKS_FAILED++)); }
((expr)) returns a non-zero exit status when expr evaluates to 0. Post-increment returns the old value, so the first call (when the counter is 0) exits 1 and set -e terminates the script before any further checks run.
Fix
Use explicit assignment, which always exits 0:
pass() { echo "OK: $1"; CHECKS_PASSED=$((CHECKS_PASSED + 1)); }
fail() { echo "FAIL: $1"; CHECKS_FAILED=$((CHECKS_FAILED + 1)); }
Impact
- Post-deploy healthchecks have been silently skipping the version/errors/Bot-API checks since the script was added.
- Exit code 1 was masking the missing checks — deploy scripts using the healthcheck would have flagged successful deploys as failed.
Affected files
scripts/healthcheck.sh (lines 26–27)
Problem
scripts/healthcheck.shaborts after the firstpassorfailcall, reporting only one check instead of all five.Root cause
The script runs under
set -euo pipefail. Both counter helpers use post-increment arithmetic:((expr))returns a non-zero exit status whenexprevaluates to 0. Post-increment returns the old value, so the first call (when the counter is 0) exits 1 andset -eterminates the script before any further checks run.Fix
Use explicit assignment, which always exits 0:
Impact
Affected files
scripts/healthcheck.sh(lines 26–27)