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.
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
- Open the HCP Terraform settings and copy the organization name exactly.
- Match it in the
cloudblock, including case and hyphens. - Re-run init.
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.