Skip to content

fix(schedulers): aidevops update exits 1 due to unbound variable in schedulers.sh line 613 #17807

@alex-solovyev

Description

@alex-solovyev

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-something silently skips run-something
  • User confusion: "did the update succeed or not?" — the [OK] Updated to version 3.6.161 suggests 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:

  • $12 referenced without ${12:-} default
  • Array element ${arr[12]} where index is out of bounds
  • Integer 12 being treated as a variable name (shell substitution typo)

How

  1. Open ~/Git/aidevops/setup-modules/schedulers.sh and navigate to line 613
  2. 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
  3. Test: bash -n setup-modules/schedulers.sh (syntax check) and run the full update path in a test environment
  4. Add a regression guard: run bash -u setup-modules/schedulers.sh --test-mode in CI

Acceptance criteria

  • aidevops update exits 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 update in 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.

Metadata

Metadata

Labels

ciAuto-created from TODO.md tagorigin:workerCreated from worker sessionshellAuto-created from TODO.md tagstatus:doneTask is complete

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions