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 new

View on GitHub (pinned to c9def3e214)

Solutions

  1. Retry the operation — transient backend load or network blips are the most common cause.
  2. Check TFE/HCP status page and the configuration version status in the UI for stuck/in-error states.
  3. Verify network connectivity and that the TFE host is reachable and not rate-limiting.
  4. 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

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

Related errors


AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07). Data as JSON: /api/errors/1d0e864c796a6f32. Report an issue: GitHub.