{"record":{"id":"1b380bc64e973d3e","repo":"hashicorp/terraform","slug":"current-outputs-were-not-ready-to-be-read-within-t","errorCode":null,"errorMessage":"current outputs were not ready to be read within the deadline. Please try again","messagePattern":"current outputs were not ready to be read within the deadline\\. Please try again","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/cloud/state.go","lineNumber":568,"sourceCode":"\n\tvar so *tfe.StateVersionOutputsList\n\terr := RetryBackoff(ctx, func() error {\n\t\tvar err error\n\t\tso, err = s.tfeClient.StateVersionOutputs.ReadCurrent(ctx, s.workspace.ID)\n\n\t\tif err != nil {\n\t\t\tif strings.Contains(err.Error(), \"service unavailable\") {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn NonRetryableError{err}\n\t\t}\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tswitch err {\n\t\tcase context.DeadlineExceeded:\n\t\t\treturn nil, fmt.Errorf(\"current outputs were not ready to be read within the deadline. Please try again\")\n\t\tcase context.Canceled:\n\t\t\treturn nil, fmt.Errorf(\"canceled reading current outputs\")\n\t\t}\n\t\treturn nil, fmt.Errorf(\"could not read state version outputs: %w\", err)\n\t}\n\n\tresult := make(map[string]*states.OutputValue)\n\n\tfor _, output := range so.Items {\n\t\tif output.DetailedType == nil {\n\t\t\t// If there is no detailed type information available, this state was probably created\n\t\t\t// with a version of terraform < 1.3.0. In this case, we'll eject completely from this\n\t\t\t// function and fall back to the old behavior of reading the entire state file, which\n\t\t\t// requires a higher level of authorization.\n\t\t\tlog.Printf(\"[DEBUG] falling back to reading full state\")\n\n\t\t\tif err := s.RefreshState(); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to load state: %w\", err)","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/cloud/state.go#L550-L586","documentation":"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.","triggerScenarios":"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.","commonSituations":"A very fresh workspace right after apply, heavy server load, or a slow outputs pipeline on the server side.","solutions":["Simply retry the operation; outputs become available shortly.","Wait a few seconds after an apply before reading outputs.","If it persists, check the HCP/TFE status page.","For automation, wrap the read in a short retry loop."],"exampleFix":"// before: read outputs the instant apply returns -> not ready within deadline\nouts, err := state.GetRootOutputValues(ctx)\n\n// after: back off briefly before reading freshly-written outputs\ntime.Sleep(5 * time.Second)\nouts, err := state.GetRootOutputValues(ctx)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"outs, err := state.GetRootOutputValues(ctx)\nif err != nil && strings.Contains(err.Error(), \"not ready to be read within the deadline\") {\n    // back off a few seconds and retry reading the freshly-uploaded outputs\n}","preventionTips":["Wait a few seconds after apply before reading outputs","Wrap output reads in a bounded retry loop","Avoid hammering the outputs endpoint right after upload"],"tags":["outputs","retry","timeout","transient"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}