{"record":{"id":"e156a47f82a31786","repo":"hashicorp/terraform","slug":"couldn-t-read-plan-data-for-cloud-run-s-w","errorCode":null,"errorMessage":"couldn't read plan data for cloud run %s: %w","messagePattern":"couldn't read plan data for cloud run (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/backend_show.go","lineNumber":75,"sourceCode":"\t\t// Bail, we can't use this.\n\t\terr = fmt.Errorf(\"can't display a cloud plan that is currently %s\", r.Plan.Status)\n\t\treturn nil, err\n\t}\n\n\t// Fetch the json plan!\n\tif redacted {\n\t\tjsonBytes, err = readRedactedPlan(ctx, b.client.BaseURL(), b.Token, r.Plan.ID)\n\t} else {\n\t\tjsonBytes, err = b.client.Plans.ReadJSONOutput(ctx, r.Plan.ID)\n\t}\n\tif err == tfe.ErrResourceNotFound {\n\t\tif redacted {\n\t\t\treturn 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)\n\t\t} else {\n\t\t\treturn 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)\n\t\t}\n\t} else if err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't read plan data for cloud run %s: %w\", runID, err)\n\t}\n\n\t// Format a run header and footer\n\theader := strings.TrimSpace(fmt.Sprintf(runHeader, b.Hostname, b.Organization, r.Workspace.Name, r.ID))\n\tfooter := strings.TrimSpace(statusFooter(r.Status, r.Actions.IsConfirmable, r.Workspace.Locked))\n\n\tout := &cloudplan.RemotePlanJSON{\n\t\tJSONBytes: jsonBytes,\n\t\tRedacted:  redacted,\n\t\tMode:      mode,\n\t\tQualities: opts,\n\t\tRunHeader: header,\n\t\tRunFooter: footer,\n\t}\n\n\treturn out, nil\n}\n","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/cloud/backend_show.go#L57-L93","documentation":"Thrown by Cloud.ShowPlanForRun when fetching plan JSON (either redacted via readRedactedPlan or unredacted via Plans.ReadJSONOutput) fails with any error other than tfe.ErrResourceNotFound. The wrapped %w carries the underlying cause.","triggerScenarios":"The plan-output fetch errors on a 5xx, network timeout, TLS issue, streaming-decode failure, or context cancellation. Distinct from the 404-specific messages, this covers all infrastructure-level failures of the plan-output endpoint.","commonSituations":"TFE plan-output service temporarily unavailable; large plan output timing out at a gateway; client-side context cancelled mid-download; transient network blip during `terraform show`.","solutions":["Inspect the wrapped `%w` cause to classify transport vs server vs decode errors.","Retry `terraform show` for transient failures.","Verify connectivity/TLS to the TFE hostname.","If the plan output is very large, retry on a stable connection."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"jsonBytes, err = b.client.Plans.ReadJSONOutput(ctx, planID)\nif err != nil && err != tfe.ErrResourceNotFound {\n    // classify transient vs fatal; retry transient\n}","preventionTips":["Maintain stable connectivity to TFE during `terraform show`.","Retry transient plan-output fetch failures.","Avoid cancelling the show operation mid-download."],"tags":["terraform","show","cloud-plan","network","api","retry"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}