Skip to content
Latchkey

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

  1. Re-run to clear a transient upload failure.
  2. Add heavy directories to .terraformignore so they are not uploaded.
  3. 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 .terraformignore to exclude artifacts from the upload.
  • Allow egress to app.terraform.io from CI networks.

Related guides

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