Skip to content
Latchkey

Terraform Cloud "Run ... errored" remote run failure in CI

The run executed on HCP Terraform infrastructure and finished in the "errored" state. The CLI only surfaces the final status: the underlying provider, plan, or apply error lives in the remote run log, not in the CI console.

What this error means

A remote plan or apply ends with a run status of "errored" and the CI step exits non-zero, often with a link to the run in HCP Terraform.

terraform
Terraform Cloud/Enterprise run finished with status: errored
View this run in HCP Terraform: https://app.terraform.io/app/acme-corp/workspaces/prod/runs/run-XYZ

Common causes

A provider or resource error during the remote run

The plan or apply failed on the remote (bad credentials to the target cloud, an invalid resource argument), and only the run log holds the detail.

A missing variable or variable set on the workspace

A required Terraform or environment variable is not set on the workspace, so the remote run cannot authenticate or configure a resource.

How to fix it

Open the run log for the real error

  1. Follow the run URL printed by the CLI.
  2. Read the plan/apply log for the first real error line.
  3. Fix the provider credential, variable, or resource argument it names.

Set the missing workspace variables

Attach the required variables (or a shared variable set) to the workspace so the remote run has its cloud credentials and inputs.

Terminal
# HCP Terraform: Workspace > Variables (or attach a Variable Set)
# e.g. AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY as environment variables.

How to prevent it

  • Attach variable sets so every workspace has its credentials.
  • Read the remote run log, not just the CLI status, when a run errors.
  • Validate provider inputs before promoting to prod workspaces.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →