hashicorp/terraform · warning
canceled reading current outputs
Error message
canceled reading current outputs
What it means
Thrown by GetRootOutputValues when the caller-supplied context (not the internal 1-minute deadline) is canceled while RetryBackoff is retrying StateVersionOutputs.ReadCurrent. This is distinct from DeadlineExceeded: the parent context was explicitly canceled, typically because the user pressed Ctrl+C or the calling command was terminated.
Solutions
- If intentional cancellation, no action needed — this is expected behavior
- If unexpected, investigate why the parent context was canceled (upstream timeout, signal handling)
- Avoid canceling terraform mid-operation if output consistency is needed; let operations complete
Defensive patterns
Strategy: try-catch
Validate before calling
// Use a context that will not be prematurely canceled: ctx := context.Background() // or a context with a generous deadline, not one tied to an interrupt outputs, err := state.GetRootOutputValues(ctx)
Try / catch
outputs, err := state.GetRootOutputValues(ctx)
if err != nil {
if errors.Is(ctx.Err(), context.Canceled) || strings.Contains(err.Error(), "canceled reading") {
// caller intentionally canceled — no retry needed
return nil, err
}
return nil, err
} Prevention
- Do not bind the context for GetRootOutputValues to a SIGINT handler that cancels immediately
- In CI, ensure the job timeout exceeds the expected output-read window
- Let terraform complete output reading before terminating the process
When it happens
Trigger: User cancels the terraform command (Ctrl+C / SIGINT) during output reading; parent process (CI runner, wrapper script) terminates and cancels the context; a programmatic caller cancels the context due to its own timeout or shutdown.
Common situations: User impatient during a slow output read and presses Ctrl+C; CI job cancelled by the orchestration system; terraform invoked as a subprocess and the parent process is killed.
Related errors
- current outputs were not ready to be read within the…
- could not decode output
- could not interpret output
- could not interpret value
- could not marshal output
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/0fef894f05a82e94.
Report an issue: GitHub.
Appendix: source
Thrown at internal/cloud/state.go:570
err := RetryBackoff(ctx, func() error {
var err error
so, err = s.tfeClient.StateVersionOutputs.ReadCurrent(ctx, s.workspace.ID)
if err != nil {
if strings.Contains(err.Error(), "service unavailable") {
return err
}
return NonRetryableError{err}
}
return nil
})
if err != nil {
switch err {
case context.DeadlineExceeded:
return nil, fmt.Errorf("current outputs were not ready to be read within the deadline. Please try again")
case context.Canceled:
return nil, fmt.Errorf("canceled reading current outputs")
}
return nil, fmt.Errorf("could not read state version outputs: %w", err)
}
result := make(map[string]*states.OutputValue)
for _, output := range so.Items {
if output.DetailedType == nil {
// If there is no detailed type information available, this state was probably created
// with a version of terraform < 1.3.0. In this case, we'll eject completely from this
// function and fall back to the old behavior of reading the entire state file, which
// requires a higher level of authorization.
log.Printf("[DEBUG] falling back to reading full state")
if err := s.RefreshState(); err != nil {
return nil, fmt.Errorf("failed to load state: %w", err)
}
View on GitHub (pinned to d32a084675)