Terraform Cloud "Failed to upload configuration" in CI
To start a CLI-driven remote run, the CLI packages the working directory and uploads it to HCP Terraform. This upload can fail on a network drop, an oversized bundle, or a .terraformignore that omitted needed files.
What this error means
A remote plan fails early with "Error: Failed to upload configuration files" before any plan output appears.
terraform
Error: Failed to upload configuration files: request failed
Could not upload the configuration to HCP Terraform. Check your network
connection and try again.Common causes
A transient network failure during upload
The bundle upload dropped mid-transfer due to flaky egress or a brief API outage.
An oversized or misfiltered config bundle
A huge working directory (checked-in artifacts, large state, node_modules) makes the upload slow or too large, or a .terraformignore excluded required files.
How to fix it
Retry and slim the upload
- Re-run to clear a transient upload failure.
- Add heavy directories to
.terraformignoreso they are not uploaded. - Keep the working directory lean (no build output or vendored deps).
.terraformignore
# .terraformignore
node_modules/
**/*.zip
.git/Check egress to app.terraform.io
Ensure the runner can reach app.terraform.io over HTTPS and any proxy allows the upload endpoint.
How to prevent it
- Keep the Terraform working directory small.
- Use
.terraformignoreto exclude artifacts from the upload. - Allow egress to app.terraform.io from CI networks.
Related guides
Terraform Cloud "returned an unexpected error" 429 rate limit in CIFix Terraform Cloud "returned an unexpected error ... 429" in CI - the API rate limit was hit because too man…
Terraform Cloud "context deadline exceeded" in CIFix Terraform Cloud "Error: context deadline exceeded" in CI - a request to HCP Terraform timed out because t…
Terraform Cloud "Run ... errored" remote run failure in CIFix a Terraform Cloud remote run that ends "errored" in CI - the run reached plan or apply on the remote and…