Interview Prep/Terraform/State Locking and Backend Errors

HCP Terraform: the run sits in `Pending` or `Plan queued` for a long time and nothing happens.

IntermediateTroubleshootingState Locking and Backend Errors
Answer

Likely causes → Another run in that workspace is waiting for confirmation (Needs confirmation), so later runs queue behind it; the workspace is locked manually; agent-pool workspaces have no healthy agent; the organization hit its concurrency limit.

Diagnose → Open the workspace's Runs list and the agent pool status. Check Settings > Locking.

Fix → Apply or discard the run that awaits confirmation, unlock the workspace, or restart/scale the agents.

Prevent → Auto-discard stale speculative runs, keep agent pools sized with health checks, and alert on runs pending longer than N minutes.

All Terraform questions Roadmap: Terraform in production

More on State Locking and Backend Errors