Fix provision-forgejo-runner-registration-token.sh: stale --output/--query flags break the token-restore bootstrap #539
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/infrastructure#539
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
scripts/provision-forgejo-runner-registration-token.shis broken against the currentwardand fails silently at exactly the moment it is needed - restoring the Forgejo runner registration token after it goes missing from SSM (e.g. the post-reboot incident in infrastructure#538).The script mints the token with:
But
ward ops forgejo actions generate-runner-tokenis an exec-dialect verb (it wraps the in-podforgejoCLI viakubectl exec), not a spec-driven HTTP verb, so it does not define--output/--query. The run dies with:Reproduced live on 2026-07-10 during the infrastructure#538 recovery: with
/forgejo/runner-registration-tokenabsent from SSM,forgejo-runner-3was stuckInit:CreateContainerConfigError(couldn't find key runner-token in Secret forgejo/forgejo-runner-secrets), and the operator bootstrap script could not re-mint the token to fix it. The operator had to hand-edit the script tokubectl -n forgejo exec deploy/forgejo -- forgejo actions generate-runner-tokento recover.Do
ward ops forgejo actions generate-runner-tokenoutput contract. Check what the verb actually prints today (--help+ a bare run), then extract the token from that output instead of the non-existent--output text --query tokenflags. A robust extraction isgrep -Eo '[0-9a-f]{40}' | head -1, which works whether the verb prints the bare token or wraps it in a line.^[0-9a-f]{40}$validation and the SecureStringward ops aws ssm put-parameterstore unchanged.kubectl -n forgejo exec deploy/forgejo -- forgejo actions generate-runner-tokenfallback (the in-pod path the wrapper is meant to abstract), guarded so the ward path is preferred when available./forgejo/runner-registration-token, theforgejo-runner-secrets/forgejo-runner-deploy-secretsExternalSecrets sync therunner-tokenkey, and a freshforgejo-runner-*pod reaches2/2 Running.Acceptance
bash scripts/provision-forgejo-runner-registration-token.shmints and stores a valid registration token on a current-ward operator shell with no hand-editing.docs/cd-runner.md,docs/FEATURES.mdrunner entries) still describe the actual invocation.Context
Surfaced during the infrastructure#538 post-reboot recovery. The runner-token restore is the operator path that unwedges the whole Forgejo Actions runner fleet after the SSM param is lost, so a silent failure here blocks CI recovery for every repo. This is a headless code fix - the script and its extraction logic, no host access required to author it. Refs: infrastructure#538,
deploy/forgejo-runner.yml,deploy/forgejo-runner-deploy.yml,docs/cd-runner.md.WARD-RESERVATION: held 🔒
reservation details
Holder: container
engineer-claude-infrastructure-539on hostkais-macbook-pro-2.local.Reserved by
ward agent --harness claude(reserved 2026-07-10T17:27:57Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (1h TTL).--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh. That is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
run seed context — what this run is carrying (ward#609)
coilyco-flight-deck/infrastructure#539· branchissue-539· harnessclaude· workflowdirect-mainengineer-claude-infrastructure-539· wardv0.584.0· dispatched2026-07-10T17:27:57ZStatic container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.584.0).
— Claude (she/her), via
ward agent