-
Notifications
You must be signed in to change notification settings - Fork 39
fix(schedulers): aidevops update exits 1 due to unbound variable in schedulers.sh line 613 #17807
Description
What
aidevops update exits with code 1 at the end of an otherwise-successful update due to an unbound variable in schedulers.sh:
[INFO] Supervisor pulse enabled (every 2 min) (systemd user timer)
[schedulers] Removed pre-existing cron entry for aidevops: supervisor-pulse (migrated to systemd)
/home/alexey/Git/aidevops/setup-modules/schedulers.sh: line 613: 12: unbound variable
[WARN] Setup exited with code 1
[OK] Updated to version 3.6.161 (agents deployed)
The update itself succeeds — framework version is bumped, agents are deployed, MCPs are configured — but the non-zero exit code can break CI pipelines, automation scripts, and anyone who checks $? after the update.
Why
- CI/automation breakage: any wrapper that does
aidevops update && run-somethingsilently skipsrun-something - User confusion: "did the update succeed or not?" — the
[OK] Updated to version 3.6.161suggests yes, but exit 1 suggests no - Observed: this session's auto-update polling triggered the same behaviour at least twice; framework appears to have continued working
Evidence
From awardsapp QA session 2026-04-08, during aidevops update:
/home/alexey/Git/aidevops/setup-modules/schedulers.sh: line 613: 12: unbound variable
[1;33m[WARN][0m Setup exited with code 1
[0;32m[OK][0m Updated to version 3.6.161 (agents deployed)
Root cause
Script runs under set -u (unbound variable detection enabled). At line 613 of setup-modules/schedulers.sh, a variable named 12 is referenced — which looks like a positional parameter $12 that's not set, or a typo where an index was meant as a variable name. Without seeing the code, the most likely candidates:
$12referenced without${12:-}default- Array element
${arr[12]}where index is out of bounds - Integer
12being treated as a variable name (shell substitution typo)
How
- Open
~/Git/aidevops/setup-modules/schedulers.shand navigate to line 613 - Fix the unbound reference:
- Add
${VAR:-default}if it's legit positional param - Check bounds before array access
- Fix typo if it's a variable-name bug
- Add
- Test:
bash -n setup-modules/schedulers.sh(syntax check) and run the full update path in a test environment - Add a regression guard: run
bash -u setup-modules/schedulers.sh --test-modein CI
Acceptance criteria
-
aidevops updateexits 0 on a successful update (no unbound variable errors) - All existing functionality (cron/systemd migration, pulse enable/disable) still works
- CI smoke test runs
aidevops updatein a fresh environment and asserts exit 0
Verification
aidevops update; echo "exit=$?"
# Expect: exit=0#bug #tooling #shell #ci
aidevops.sh v3.6.165 plugin for OpenCode v1.4.0 with claude-opus-4-6 spent 4h 46m and 111,474 tokens on this with the user in an interactive session.