hashicorp/terraform · warning

can't display a cloud plan that is currently %s

Error message

can't display a cloud plan that is currently %s

What it means

Returned by ShowPlanForRun when the run's Plan.Status is neither PlanFinished nor PlanErrored (e.g. pending, queued, running, canceled). A plan JSON is only downloadable once the plan has reached a displayable state.

Source

Thrown at internal/cloud/backend_show.go:58

	if r.IsDestroy {
		mode = plans.DestroyMode
	} else if r.RefreshOnly {
		mode = plans.RefreshOnlyMode
	}

	// Check that the plan actually finished
	switch r.Plan.Status {
	case tfe.PlanErrored:
		// Errored plans might still be displayable, but we want to mention it to the renderer.
		opts = append(opts, plans.Errored)
	case tfe.PlanFinished:
		// Good to go, but alert the renderer if it has no changes.
		if !r.Plan.HasChanges {
			opts = append(opts, plans.NoChanges)
		}
	default:
		// Bail, we can't use this.
		err = fmt.Errorf("can't display a cloud plan that is currently %s", r.Plan.Status)
		return nil, err
	}

	// Fetch the json plan!
	if redacted {
		jsonBytes, err = readRedactedPlan(ctx, b.client.BaseURL(), b.Token, r.Plan.ID)
	} else {
		jsonBytes, err = b.client.Plans.ReadJSONOutput(ctx, r.Plan.ID)
	}
	if err == tfe.ErrResourceNotFound {
		if redacted {
			return nil, fmt.Errorf("couldn't read plan data for cloud run %s; make sure you've run `terraform login` and that you have permission to view the run", runID)
		} else {
			return nil, fmt.Errorf("couldn't read unredacted JSON plan data for cloud run %s; make sure you've run `terraform login` and that you have admin permissions on the workspace", runID)
		}
	} else if err != nil {
		return nil, fmt.Errorf("couldn't read plan data for cloud run %s: %w", runID, err)
	}

View on GitHub (pinned to c9def3e214)

Solutions

  1. Wait for the plan to reach 'finished' (or 'errored') in the UI/API and retry the show.
  2. Poll the run status (Runs.Read) until r.Plan.Status is finished/errored before calling ShowPlanForRun.
  3. If the plan was canceled, restart the run and wait for completion.

Example fix

// before: show immediately after creating a run
json, err := b.ShowPlanForRun(ctx, r.ID, host, true)
// after: wait until plan is displayable
for r.Plan.Status == tfe.PlanPending || r.Plan.Status == tfe.PlanQueued {
    r, _ = b.client.Runs.Read(ctx, r.ID)
    time.Sleep(poll)
}
json, err := b.ShowPlanForRun(ctx, r.ID, host, true)
Defensive patterns

Strategy: validation

Validate before calling

// Only call ShowPlanForRun once the plan is displayable.
func planDisplayable(s tfe.PlanStatus) bool {
    return s == tfe.PlanFinished || s == tfe.PlanErrored
}
if !planDisplayable(r.Plan.Status) {
    return fmt.Errorf("plan still %s; wait and retry", r.Plan.Status)
}

Type guard

func isDisplayablePlanStatus(s tfe.PlanStatus) bool {
    return s == tfe.PlanFinished || s == tfe.PlanErrored
}

Prevention

When it happens

Trigger: Showing a run while its plan phase is still in flight: status pending/queued/running/canceled/canceled. The switch falls to default and rejects displaying it.

Common situations: Running `terraform show -out` style display against a run that has not finished planning yet; race between starting a run and immediately showing it; plan that got canceled.

Related errors


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