hashicorp/terraform · warning

current outputs were not ready to be read within the deadlin

Error message

current outputs were not ready to be read within the deadline. Please try again

What it means

GetRootOutputValues retries StateVersionOutputs.ReadCurrent with backoff for up to one minute. If the current state version's outputs are still returning 'service unavailable' (the server is still processing the freshly-uploaded version) when the deadline hits, it gives up with this message.

Source

Thrown at internal/cloud/state.go:568

	var so *tfe.StateVersionOutputsList
	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. Simply retry the operation; outputs become available shortly.
  2. Wait a few seconds after an apply before reading outputs.
  3. If it persists, check the HCP/TFE status page.
  4. For automation, wrap the read in a short retry loop.

Example fix

// before: read outputs the instant apply returns -> not ready within deadline
outs, err := state.GetRootOutputValues(ctx)

// after: back off briefly before reading freshly-written outputs
time.Sleep(5 * time.Second)
outs, err := state.GetRootOutputValues(ctx)
Defensive patterns

Strategy: retry

Try / catch

outs, err := state.GetRootOutputValues(ctx)
if err != nil && strings.Contains(err.Error(), "not ready to be read within the deadline") {
    // back off a few seconds and retry reading the freshly-uploaded outputs
}

Prevention

When it happens

Trigger: Reading outputs immediately after a state upload while HCP/TFE is still computing/storing the outputs; under server load the outputs endpoint stays unavailable past the 60s deadline.

Common situations: A very fresh workspace right after apply, heavy server load, or a slow outputs pipeline on the server side.

Related errors


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