{"record":{"id":"7158fdf1e431705f","repo":"hashicorp/terraform","slug":"invalid-retry-wait-max-s","errorCode":null,"errorMessage":"invalid retry_wait_max: %s","messagePattern":"invalid retry_wait_max: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/http/backend.go","lineNumber":217,"sourceCode":"\t\tbackendbase.GetAttrEnvDefaultFallback(\n\t\t\tconfigVal, \"retry_wait_min\",\n\t\t\t\"TF_HTTP_RETRY_WAIT_MIN\", cty.NumberIntVal(1),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn backendbase.ErrorAsDiagnostics(\n\t\t\tfmt.Errorf(\"invalid retry_wait_min: %s\", err),\n\t\t)\n\t}\n\tretryWaitMax, err := backendbase.IntValue(\n\t\tbackendbase.GetAttrEnvDefaultFallback(\n\t\t\tconfigVal, \"retry_wait_max\",\n\t\t\t\"TF_HTTP_RETRY_WAIT_MAX\", cty.NumberIntVal(30),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn backendbase.ErrorAsDiagnostics(\n\t\t\tfmt.Errorf(\"invalid retry_wait_max: %s\", err),\n\t\t)\n\t}\n\n\trClient := retryablehttp.NewClient()\n\trClient.RetryMax = int(retryMax)\n\trClient.RetryWaitMin = time.Duration(retryWaitMin) * time.Second\n\trClient.RetryWaitMax = time.Duration(retryWaitMax) * time.Second\n\trClient.Logger = log.New(logging.LogOutput(), \"\", log.Flags())\n\tif err = b.configureTLS(rClient, configVal); err != nil {\n\t\treturn backendbase.ErrorAsDiagnostics(err)\n\t}\n\n\tb.client = &httpClient{\n\t\tURL:          updateURL,\n\t\tUpdateMethod: updateMethod,\n\n\t\tLockURL:      lockURL,\n\t\tLockMethod:   lockMethod,","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote-state/http/backend.go#L199-L235","documentation":"backendbase.IntValue failed to convert the retry_wait_max value (attribute or TF_HTTP_RETRY_WAIT_MAX, default 30 seconds) to an int. Must be a whole number; fractional, NaN, Infinity, or out-of-range values are rejected.","triggerScenarios":"retry_wait_max set to a fractional number, NaN/Infinity, or a value exceeding int range.","commonSituations":"User sets retry_wait_max = 30.5; a variable evaluates to a float; mismatched units (assuming milliseconds).","solutions":["Set retry_wait_max to a non-negative integer representing seconds (e.g. retry_wait_max = 30).","Remove the setting to use the default of 30 seconds.","Ensure retry_wait_max >= retry_wait_min."],"exampleFix":"// before\nretry_wait_max = 30.5\n// after\nretry_wait_max = 30","handlingStrategy":"validation","validationCode":"# Pre-flight: retry_wait_max must be a non-negative integer (seconds)\nif [ -n \"$TF_HTTP_RETRY_WAIT_MAX\" ]; then\n  case \"$TF_HTTP_RETRY_WAIT_MAX\" in\n    ''|*[!0-9]*) echo \"ERROR: retry_wait_max must be a non-negative integer, got: $TF_HTTP_RETRY_WAIT_MAX\"; exit 1 ;;\n  esac\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set retry_wait_max to a whole number of seconds.","Ensure retry_wait_max >= retry_wait_min.","Leave unset to accept the default of 30 seconds."],"tags":["config","validation","http-backend","retry"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}