hashicorp/terraform · error
invalid retry_wait_max
Error message
invalid retry_wait_max: %s
What it means
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.
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.
Example fix
// before retry_wait_max = 30.5 // after retry_wait_max = 30
Defensive patterns
Strategy: validation
Validate before calling
# Pre-flight: retry_wait_max must be a non-negative integer (seconds)
if [ -n "$TF_HTTP_RETRY_WAIT_MAX" ]; then
case "$TF_HTTP_RETRY_WAIT_MAX" in
''|*[!0-9]*) echo "ERROR: retry_wait_max must be a non-negative integer, got: $TF_HTTP_RETRY_WAIT_MAX"; exit 1 ;;
esac
fi Prevention
- 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.
When it happens
Trigger: retry_wait_max set to a fractional number, NaN/Infinity, or a value exceeding int range.
Common situations: User sets retry_wait_max = 30.5; a variable evaluates to a float; mismatched units (assuming milliseconds).
Related errors
- invalid retry_max
- invalid retry_wait_min
- client_certificate_pem is set but client_private_key_pem is…
- client_private_key_pem is set but client_certificate_pem is…
- address must be HTTP or HTTPS
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/7158fdf1e431705f.
Report an issue: GitHub.
Appendix: source
Thrown at internal/backend/remote-state/http/backend.go:217
backendbase.GetAttrEnvDefaultFallback(
configVal, "retry_wait_min",
"TF_HTTP_RETRY_WAIT_MIN", cty.NumberIntVal(1),
),
)
if err != nil {
return backendbase.ErrorAsDiagnostics(
fmt.Errorf("invalid retry_wait_min: %s", err),
)
}
retryWaitMax, err := backendbase.IntValue(
backendbase.GetAttrEnvDefaultFallback(
configVal, "retry_wait_max",
"TF_HTTP_RETRY_WAIT_MAX", cty.NumberIntVal(30),
),
)
if err != nil {
return backendbase.ErrorAsDiagnostics(
fmt.Errorf("invalid retry_wait_max: %s", err),
)
}
rClient := retryablehttp.NewClient()
rClient.RetryMax = int(retryMax)
rClient.RetryWaitMin = time.Duration(retryWaitMin) * time.Second
rClient.RetryWaitMax = time.Duration(retryWaitMax) * time.Second
rClient.Logger = log.New(logging.LogOutput(), "", log.Flags())
if err = b.configureTLS(rClient, configVal); err != nil {
return backendbase.ErrorAsDiagnostics(err)
}
b.client = &httpClient{
URL: updateURL,
UpdateMethod: updateMethod,
LockURL: lockURL,
LockMethod: lockMethod,View on GitHub (pinned to d32a084675)