SigNoz/signoz · error
CodeInvalidInput
CodeInvalidInput
Error message
lifetime::idle must not be negative
What it means
tokenizer Config.Validate rejects negative Lifetime.Idle values. Lifetime.Idle controls how long idle tokens may live; a negative duration is nonsensical and is treated as invalid configuration before the tokenizer starts.
Source
Thrown at pkg/tokenizer/config.go:98
},
JWT: JWTConfig{
Secret: "",
},
Rotation: RotationConfig{
Interval: 30 * time.Minute, // 30 minutes
Duration: 60 * time.Second, // 60 seconds
},
Lifetime: LifetimeConfig{
Idle: 7 * 24 * time.Hour, // 7 days
Max: 30 * 24 * time.Hour, // 30 days
},
}
}
func (c Config) Validate() error {
// Ensure that lifetime idle is not negative
if c.Lifetime.Idle < 0 {
return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "lifetime::idle must not be negative")
}
// Ensure that lifetime max is not negative
if c.Lifetime.Max < 0 {
return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "lifetime::max must not be negative")
}
// Ensure that rotation interval is smaller than lifetime idle
if c.Rotation.Interval >= c.Lifetime.Idle {
return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "rotation::interval must be smaller than lifetime::idle")
}
// Ensure that lifetime idle interval is smaller than lifetime max
if c.Lifetime.Idle >= c.Lifetime.Max {
return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "lifetime::idle must be smaller than lifetime::max")
}
// Ensure that rotation duration is smaller than rotation intervalView on GitHub (pinned to 5069bf80b0)
Solutions
- Set Lifetime.Idle to 0 or a positive duration (use 0 to mean no idle limit if that is the semantic)
- Validate config at startup via Config.Validate() so the error surfaces immediately
- Fix the config source producing the negative value (env parser, YAML)
Example fix
// before
cfg := tokenizer.Config{Lifetime: tokenizer.Lifetime{Idle: -1 * time.Second}}
// after
cfg := tokenizer.Config{Lifetime: tokenizer.Lifetime{Idle: 30 * time.Minute}} Defensive patterns
Strategy: validation
Validate before calling
if err := cfg.Validate(); err != nil {
log.Fatal(err)
} Try / catch
if err := cfg.Validate(); err != nil {
return fmt.Errorf("invalid tokenizer config: %w", err)
} Prevention
- Reject negative durations at the config-parsing layer
- Treat 'unlimited' as explicit zero, never -1, in configuration conventions
When it happens
Trigger: Constructing tokenizer.Config with Lifetime.Idle < 0, e.g. by parsing a negative number from a config file or env var into the time.Duration field.
Common situations: Env var parsed as '-1' meaning 'unlimited' by convention but mapped directly to Duration, YAML misconfiguration, or zero-value struct combined with arithmetic that goes negative.
Understand the failure class
Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.
Related errors
- ErrCodeInvalidSQLMigratorConfig
- CodeInvalidInput
- ErrCodeIncorrectPassword
- CodeTooManyRequests
- CodeInvalidInput
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/ff63f732b2378a5c.
Report an issue: GitHub.