Skip to content
Latchkey

HCP Terraform "Failed to read organization" in CI

The token was accepted, but the organization named in your cloud { organization = "..." } block either does not exist or is not visible to that token. Terraform cannot enumerate its workspaces, so init stops.

What this error means

terraform init fails with "Error: Failed to read organization <name>" and a message that the organization does not exist or you lack permission. The token itself is valid for other calls.

terraform
Error: Failed to read organization "acme-infra"

Could not read the organization "acme-infra" at host app.terraform.io. Please
verify that the organization exists and that you have permission to access it.

Common causes

The organization name is wrong

The organization argument does not match the exact org slug in HCP Terraform, so the API returns nothing.

The token belongs to a different organization

A user or team token scoped to another org cannot read this one; authentication succeeds but authorization for the org fails.

How to fix it

Confirm the exact organization slug

  1. Open the HCP Terraform settings and copy the organization name exactly.
  2. Match it in the cloud block, including case and hyphens.
  3. Re-run init.
main.tf
terraform {
  cloud {
    organization = "acme-infra"
    workspaces { name = "network-prod" }
  }
}

Use a token scoped to that organization

Generate the API token from within the target organization (or a team in it) so it has access to that org.

How to prevent it

  • Keep the organization slug in one place (a variable or the block) and reuse it.
  • Generate CI tokens from inside the organization the pipeline manages.
  • Verify the org name after any rename in HCP Terraform.

Frequently asked questions

What causes ""Failed to read organization""?
The organization argument does not match the exact org slug in HCP Terraform, so the API returns nothing.
How do I fix "Failed to read organization"?
Confirm the exact organization slug

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card