jaegertracing/jaeger · error

trace_ttl can either be 0 or greater than or equal to 1 seco

Error message

trace_ttl can either be 0 or greater than or equal to 1 second

What it means

Validate() in the Cassandra storage config rejects a Schema.TraceTTL that is neither 0 nor at least 1 second. TTLs must either be disabled (0) or a whole second or more; sub-second values cannot be expressed by Cassandra's schema management, so they are refused rather than silently rounded.

Source

Thrown at internal/storage/cassandra/config/config.go:202

	return cluster, nil
}

func (c *Configuration) String() string {
	return fmt.Sprintf("%+v", *c)
}

func isValidTTL(duration time.Duration) bool {
	return duration == 0 || duration >= time.Second
}

func (c *Configuration) Validate() error {
	_, err := govalidator.ValidateStruct(c)
	if err != nil {
		return err
	}

	if !isValidTTL(c.Schema.TraceTTL) {
		return errors.New("trace_ttl can either be 0 or greater than or equal to 1 second")
	}

	if !isValidTTL(c.Schema.DependenciesTTL) {
		return errors.New("dependencies_ttl can either be 0 or greater than or equal to 1 second")
	}

	if c.Schema.CompactionWindow < time.Minute {
		return errors.New("compaction_window should at least be 1 minute")
	}

	return nil
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Set Schema.TraceTTL to a duration >= 1 * time.Second (e.g. 72h for typical traces).
  2. Set it to exactly 0 if trace TTL management should be disabled.
  3. Review the trace_ttl value in the Cassandra storage config for unit mistakes.

Example fix

// before
cfg.Schema.TraceTTL = 500 * time.Millisecond
// after
cfg.Schema.TraceTTL = 72 * time.Hour
Defensive patterns

Strategy: validation

Validate before calling

if ttl != 0 && ttl < time.Second {
    return errors.New("trace_ttl must be 0 or >= 1s")
}

Try / catch

if err := cfg.Validate(); err != nil {
    logger.Fatal("invalid cassandra config", zap.Error(err))
}

Prevention

When it happens

Trigger: Calling Validate on a cassandra.Configuration (via extension/storage init or TestExporterConfigError etc.) where c.Schema.TraceTTL is between 0 and 1 second exclusive (e.g. 500ms).

Common situations: Setting trace_ttl with a sub-second duration parsed from env/config; confusion over duration units in YAML ("500ms" vs "2s"); programmatically defaulting a duration to a small value.

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/9b9a2c56b4bf4f54. Report an issue: GitHub.