jaegertracing/jaeger · error

reload interval must be a positive value, or zero to disable

Error message

reload interval must be a positive value, or zero to disable automatic reloading

What it means

errNegativeInterval is returned by Config.Validate when a provider's reload interval is set to a negative duration. The interval controls automatic reloading of the sampling strategy and must be positive, or zero to disable reloading entirely.

Source

Thrown at cmd/jaeger/internal/extension/remotesampling/config.go:23

import (
	"errors"
	"time"

	"github.com/asaskevich/govalidator"
	"go.opentelemetry.io/collector/component"
	"go.opentelemetry.io/collector/config/configgrpc"
	"go.opentelemetry.io/collector/config/confighttp"
	"go.opentelemetry.io/collector/config/configoptional"
	"go.opentelemetry.io/collector/confmap"

	"github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy/adaptive"
)

var (
	errNoProvider        = errors.New("no sampling strategy provider specified, expecting 'adaptive' or 'file'")
	errMultipleProviders = errors.New("only one sampling strategy provider can be specified, 'adaptive' or 'file'")
	errNegativeInterval  = errors.New("reload interval must be a positive value, or zero to disable automatic reloading")
)

var (
	_ component.Config  = (*Config)(nil)
	_ confmap.Validator = (*Config)(nil)
)

type Config struct {
	File     configoptional.Optional[FileConfig]              `mapstructure:"file"`
	Adaptive configoptional.Optional[AdaptiveConfig]          `mapstructure:"adaptive"`
	HTTP     configoptional.Optional[confighttp.ServerConfig] `mapstructure:"http"`
	GRPC     configoptional.Optional[configgrpc.ServerConfig] `mapstructure:"grpc"`
}

type FileConfig struct {
	// File specifies a local file as the source of sampling strategies.
	Path string `mapstructure:"path"`
	// ReloadInterval is the time interval to check and reload sampling strategies file

View on GitHub (pinned to 806f444784)

Solutions

  1. Set the interval to a positive duration (e.g. 5s, 1m) to enable periodic reloading
  2. Set it explicitly to 0 if you want the strategy loaded once with no automatic reload
  3. Check any env-var interpolation or templating that could turn the value negative, e.g. `RELOAD_INTERVAL=-1`

Example fix

// before
extensions:
  remote_sampling:
    file:
      path: /etc/jaeger/sampling.json
      reload_interval: -1m
// after
extensions:
  remote_sampling:
    file:
      path: /etc/jaeger/sampling.json
      reload_interval: 1m
Defensive patterns

Strategy: validation

Validate before calling

if cfg.File != nil && cfg.File.ReloadInterval < 0 {
    return errors.New("reload_interval must be >= 0")
}
if err := cfg.Validate(); err != nil {
    return err
}

Type guard

func validInterval(d time.Duration) bool {
    return d >= 0
}

Try / catch

if err := cfg.Validate(); err != nil {
    if strings.Contains(err.Error(), "reload interval must be a positive value") {
        return fmt.Errorf("check reload_interval value: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Setting 'reload_interval' (file provider) or 'sampling_refresh_interval' (adaptive provider) to a negative duration such as -5s or -1m in the remotesampling extension config.

Common situations: YAML arithmetic or environment-variable substitution producing a negative value; misunderstanding that 0 disables reloading and assuming negative means 'always reload'; typo like '-1' intended as a placeholder.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/9cac1ed60d57029e. Report an issue: GitHub.