cilium/cilium · error
lost event send interval must be greater than 0
Error message
lost event send interval must be greater than 0
What it means
WithLostEventSendInterval is an observer option that sets how often lost-event notifications are sent; the interval must be strictly positive. A zero or negative duration is rejected by the option function so the observer is never configured with a nonsensical interval.
Source
Thrown at pkg/hubble/observer/observeroption/option.go:148
return func(o *Options) error {
o.MonitorBuffer = size
return nil
}
}
// WithMaxFlows that the ring buffer is initialized to hold.
func WithMaxFlows(capacity container.Capacity) Option {
return func(o *Options) error {
o.MaxFlows = capacity
return nil
}
}
// WithLostEventSendInterval sets the interval at which lost events are sent.
func WithLostEventSendInterval(interval time.Duration) Option {
return func(o *Options) error {
if interval <= 0 {
return errors.New("lost event send interval must be greater than 0")
}
o.LostEventSendInterval = interval
return nil
}
}
// WithOnServerInit adds a new callback to be invoked after server initialization
func WithOnServerInit(f OnServerInit) Option {
return func(o *Options) error {
o.OnServerInit = append(o.OnServerInit, f)
return nil
}
}
// WithOnServerInitFunc adds a new callback to be invoked after server initialization
func WithOnServerInitFunc(f func(Server) error) Option {
return WithOnServerInit(OnServerInitFunc(f))
}View on GitHub (pinned to ac7b90affa)
Solutions
- Pass a positive duration, e.g. WithLostEventSendInterval(1 * time.Second).
- If the value comes from config, validate/default it before applying options.
- Omit the option entirely to use the default LostEventSendInterval.
Example fix
// before
WithLostEventSendInterval(cfg.LostEventInterval) // 0 when unset
// after
if cfg.LostEventInterval > 0 { opts = append(opts, WithLostEventSendInterval(cfg.LostEventInterval)) } Defensive patterns
Strategy: validation
Validate before calling
if interval <= 0 {
return fmt.Errorf("lost event send interval must be positive, got %v", interval)
}
opts = append(opts, WithLostEventSendInterval(interval)) Try / catch
if err := opt(o); err != nil {
var d time.Duration
_ = d
return fmt.Errorf("observer option failed: %w", err)
} Prevention
- Default unset durations to a sane positive value before building options.
- Wrap option application and log which option failed.
- Never pass raw config durations without bounds-checking.
When it happens
Trigger: Calling observeroption.WithLostEventSendInterval(0) or with a negative time.Duration (e.g. -time.Second) when building observer options.
Common situations: Programmatic construction of Hubble observers/standalone servers where a config value defaults to 0 because the config key was unset and no default fallback was applied.
Understand the failure class
Background: "must be positive", "Invalid value": how libraries reject invalid parameter values (ValueError, ArgumentError, INVALID_PARAMETER_VALUE) — this error's family across 28 libraries.
Related errors
- must specify both %s and %s
- exporter builder name not set
- hubble-exporter configuration error: %w
- unknown context '%s'
- invalid labelsContext value: %s
AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31).
Data as JSON: /api/errors/efef2a0263f6d65d.
Report an issue: GitHub.