Terraform Cloud Run "Errored" - Fix Remote Plan/Apply in CI
A run in Terraform Cloud (HCP Terraform) finished in the Errored state. The remote plan or apply failed - most often a missing workspace variable/credential, a provider/auth error, or a real resource failure during apply.
What this error means
terraform apply against a cloud/remote backend streams the run, then ends with the run in the Errored state. The local CLI exits non-zero but the detail lives in the TFC run logs. A missing variable reproduces every run; a transient provider error may clear on retry.
Running apply in HCP Terraform. Output will stream here.
Error: error configuring S3 Backend: no valid credential sources found
The run "run-AbC123" has errored. See the run in HCP Terraform for details.Common causes
Missing or wrong workspace variables
The remote run executes in TFC, not your runner, so it needs its credentials and inputs as workspace variables/environment variables. A missing cloud credential or input variable fails the plan/apply.
A real plan/apply failure
A provider error, an invalid resource argument, or an actual create/update failure during apply marks the run Errored - the same as a local Terraform failure, just executed remotely.
How to fix it
Set the workspace variables the run needs
- Open the TFC run logs (the URL in the CLI output) to read the underlying error.
- Add the missing Terraform/environment variables (including cloud credentials) to the workspace.
- Confirm the workspace execution mode (remote vs local) matches how you intend it to run.
Authenticate the CLI to the right workspace
Provide a TFC API token and target the correct organization/workspace so the run is created where its variables live.
# .terraform.d/credentials.tfrc.json or TF_TOKEN_app_terraform_io env var
terraform login
terraform apply # streams the remote runHow to prevent it
- Define cloud credentials and inputs as workspace variables, not just on the runner.
- Gate changes with a TFC speculative plan on PRs before apply.
- Pin the Terraform version in the workspace to match local.