feat(plan-prod): unlock mode for a stuck state lock #124

Merged
jfraeys merged 1 commit from jfraeys/feat/plan-prod-unlock into main 2026-10-13 14:56:38 -04:00
Owner

Seen live 2026-10-13: plan and drift of the linode workspace failed on a state lock (S3 native lockfile, 412) and the error output cut off Who/Created, so the holder could not be judged.

  • scripts/plan-prod.sh unlock : reads the current lock with a 1 s plan, refuses unless it is exactly that ID (the lock changed otherwise), refuses when the holder is this machine and a tofu process is running here, prints Who/Created/Operation, requires retyping the ID on the terminal, then runs force-unlock -force . A state that is not locked is a no-op.
  • A lock error in plan/drift now prints the full Lock Info and points at the unlock command.
  • scripts/lib/tofu-unlock.sh + scripts/tests/test-tofu-unlock.sh: 10 cases against a fake tofu (malformed ID, not locked, changed lock, wrong/no confirmation, live local tofu, success with the exact ID); removing the ID-match guard fails the changed-lock case. Wired into lint. Deployment runbook troubleshooting row added.
  • Not run against the real backend.

🤖 Generated with Claude Code

Seen live 2026-10-13: plan and drift of the linode workspace failed on a state lock (S3 native lockfile, 412) and the error output cut off Who/Created, so the holder could not be judged. - scripts/plan-prod.sh unlock <lock-id>: reads the current lock with a 1 s plan, refuses unless it is exactly that ID (the lock changed otherwise), refuses when the holder is this machine and a tofu process is running here, prints Who/Created/Operation, requires retyping the ID on the terminal, then runs force-unlock -force <id>. A state that is not locked is a no-op. - A lock error in plan/drift now prints the full Lock Info and points at the unlock command. - scripts/lib/tofu-unlock.sh + scripts/tests/test-tofu-unlock.sh: 10 cases against a fake tofu (malformed ID, not locked, changed lock, wrong/no confirmation, live local tofu, success with the exact ID); removing the ID-match guard fails the changed-lock case. Wired into lint. Deployment runbook troubleshooting row added. - Not run against the real backend. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(plan-prod): unlock mode for a stuck state lock, and show the holder in the lock error
All checks were successful
Lint / lint (pull_request) Successful in 1m33s
Secret scan / scan (pull_request) Successful in 13s
886b46405e
plan-prod.sh unlock <ID> re-reads the lock, refuses if it is not exactly that ID, refuses while a local tofu runs when the
holder is this machine, and requires retyping the ID. A lock error now prints Lock Info (Who, Created) instead of cutting it off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!124
No description provided.