hashicorp/terraform · warning

canceled reading current outputs

Error message

canceled reading current outputs

What it means

The context passed to GetRootOutputValues was cancelled (e.g. the user pressed interrupt) while it was retrying or reading outputs. This is an intentional cancellation, not a state failure.

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 c9def3e214)

Solutions

  1. This is expected on cancellation; no fix is needed, just re-run when ready.
  2. Avoid cancelling mid-read if you need the outputs.
  3. Treat the error as benign (context.Canceled) rather than a state error.
Defensive patterns

Strategy: try-catch

Try / catch

outs, err := state.GetRootOutputValues(ctx)
if err != nil {
    if errors.Is(err, context.Canceled) || errors.Is(ctx.Err(), context.Canceled) {
        // benign cancellation; do not treat as a state error
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: User presses Ctrl-C, or a parent context is cancelled during output retrieval.

Common situations: Interrupting an operation, CI job cancellation, or an outer context timeout firing mid-read.

Related errors


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