grafana/k6 · error
%d is too big
Error message
%d is too big
What it means
Raised by getInt64 (a helper behind GetDurationValue) when a duration option is supplied as a uint64 greater than math.MaxInt64, so it cannot be converted to int64 without overflow.
Source
Thrown at lib/types/types.go:185
case int8:
return int64(n), nil
case int16:
return int64(n), nil
case int32:
return int64(n), nil
case int64:
return n, nil
case uint:
return int64(n), nil //nolint:gosec
case uint8:
return int64(n), nil
case uint16:
return int64(n), nil
case uint32:
return int64(n), nil
case uint64:
if n > math.MaxInt64 {
return 0, fmt.Errorf("%d is too big", n)
}
return int64(n), nil
default:
return 0, fmt.Errorf("unable to use type %T as a duration value", v)
}
}
// GetDurationValue is a helper function that can convert a lot of different
// types to time.Duration.
//
// TODO: move to a separate package and check for integer overflows?
func GetDurationValue(v any) (time.Duration, error) {
switch d := v.(type) {
case time.Duration:
return d, nil
case string:
return ParseExtendedDuration(d)
case float32:View on GitHub (pinned to 01ffac6f24)
Solutions
- Pass a smaller numeric value or a duration string
- Avoid values near or above 2^63-1 (e.g. millisecond counts beyond ~292 million years)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/types/types.go:185 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/e8121ce1329ba0e6.
Report an issue: GitHub.