hashicorp/terraform · error
operation timed out
Error message
operation timed out
What it means
Returned by the remote backend after uploading configuration files: it polls ConfigurationVersions.Read up to 60 times waiting for cv.Status to become tfe.ConfigurationUploaded. If the status never reaches 'uploaded' within that window, the upload is treated as failed with a wrapped 'operation timed out' error.
Source
Thrown at internal/backend/remote/backend_plan.go:292
case <-cancelCtx.Done():
log.Printf("[TRACE] backend/remote: operation cancelled while waiting for configuration status")
return nil, context.Canceled
case <-time.After(planConfigurationVersionsPollInterval):
log.Printf("[TRACE] backend/remote: reading configuration status")
cv, err = b.client.ConfigurationVersions.Read(stopCtx, cv.ID)
if err != nil {
return nil, generalError("Failed to retrieve configuration version", err)
}
if cv.Status == tfe.ConfigurationUploaded {
uploaded = true
}
}
}
if !uploaded {
return nil, generalError(
"Failed to upload configuration files", errors.New("operation timed out"))
}
log.Printf("[TRACE] backend/remote: configuration uploaded and ready")
runOptions := tfe.RunCreateOptions{
ConfigurationVersion: cv,
Refresh: tfe.Bool(op.PlanRefresh),
Workspace: w,
}
switch op.PlanMode {
case plans.NormalMode:
// okay, but we don't need to do anything special for this
case plans.RefreshOnlyMode:
runOptions.RefreshOnly = tfe.Bool(true)
case plans.DestroyMode:
runOptions.IsDestroy = tfe.Bool(true)
default:
// Shouldn't get here because we should update this for each newView on GitHub (pinned to c9def3e214)
Solutions
- Retry the operation — transient backend load or network blips are the most common cause.
- Check TFE/HCP status page and the configuration version status in the UI for stuck/in-error states.
- Verify network connectivity and that the TFE host is reachable and not rate-limiting.
- Increase backend capacity or reduce upload size (remove large vendored files) if uploads are chronically slow.
Defensive patterns
Strategy: retry
Try / catch
// Wrap the plan op in a bounded retry with backoff for upload timeouts:
var plan *plans.Plan
for attempt := 0; attempt < 3; attempt++ {
p, err := b.Operation(ctx, op)
if err == nil { plan = p; break }
if isTimeoutErr(err) && attempt < 2 {
time.Sleep(time.Duration(math.Pow(2, float64(attempt))) * time.Second)
continue
}
return nil, err
} Prevention
- Keep configuration uploads small (avoid vendoring large binaries).
- Monitor TFE/HCP health before kicking off runs.
- Use a stable, low-latency network path to the backend.
- Distinguish a true timeout from a context cancellation before retrying.
When it happens
Trigger: Calling 'terraform plan'/'apply' on a 'remote' backend where the TFE instance never acknowledges the uploaded configuration tarball within ~60 poll intervals (planConfigurationVersionsPollInterval each).
Common situations: TFE/HCP backend slow to process uploads; network interruption during upload; backend under heavy load; misconfigured upload URL; the configuration version stuck in 'pending'.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- operation timed out
- approved using the UI or API
- discarded using the UI or API
- overridden using the UI or API
- a network issue prevented cloud configuration; %w
AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07).
Data as JSON: /api/errors/1d0e864c796a6f32.
Report an issue: GitHub.