jaegertracing/jaeger · error

start Time Minimum is above Maximum

Error message

start Time Minimum is above Maximum

What it means

ErrStartTimeMinGreaterThanMax is returned by validateQuery when the query's StartTimeMax is before StartTimeMin. The Cassandra reader builds a time-range predicate for the search; an inverted range can never match rows, so the reader rejects it up front with this descriptive sentinel error.

Source

Thrown at internal/storage/v1/cassandra/spanstore/reader.go:69

		LIMIT ?`
	queryByDuration = `
		SELECT trace_id
		FROM duration_index
		WHERE bucket = ? AND service_name = ? AND operation_name = ? AND duration >= ? AND duration <= ?
		LIMIT ?`

	defaultNumTraces = 100
	// limitMultiple exists because many spans that are returned from indices can have the same trace, limitMultiple increases
	// the number of responses from the index, so we can respect the user's limit value they provided.
	limitMultiple = 3
)

var (
	// ErrServiceNameNotSet occurs when attempting to query with an empty service name
	ErrServiceNameNotSet = errors.New("service Name must be set")

	// ErrStartTimeMinGreaterThanMax occurs when start time min is above start time max
	ErrStartTimeMinGreaterThanMax = errors.New("start Time Minimum is above Maximum")

	// ErrDurationMinGreaterThanMax occurs when duration min is above duration max
	ErrDurationMinGreaterThanMax = errors.New("duration Minimum is above Maximum")

	// ErrMalformedRequestObject occurs when a request object is nil
	ErrMalformedRequestObject = errors.New("malformed request object")

	// ErrDurationAndTagQueryNotSupported occurs when duration and tags are both set
	ErrDurationAndTagQueryNotSupported = errors.New("cannot query for duration and tags simultaneously")

	// ErrStartAndEndTimeNotSet occurs when start time and end time are not set
	ErrStartAndEndTimeNotSet = errors.New("start and End Time must be set")
)

type serviceNamesReader func() ([]string, error)

type operationNamesReader func(query tracestore.OperationQueryParams) ([]tracestore.Operation, error)

View on GitHub (pinned to 806f444784)

Solutions

  1. Swap the values so StartTimeMin <= StartTimeMax before calling FindTraces.
  2. Add caller-side validation: if StartTimeMax.Before(StartTimeMin), return a 400-style error to the client.
  3. Audit timestamp assignment/conversion code (unit and timezone) that produces the range.

Example fix

// before
q.StartTimeMin, q.StartTimeMax = end, start
// after
if start.After(end) { start, end = end, start }
q.StartTimeMin, q.StartTimeMax = start, end
Defensive patterns

Strategy: validation

Validate before calling

if !q.StartTimeMax.Before(q.StartTimeMin) == false || q.StartTimeMin.After(q.StartTimeMax) {
    return errors.New("start time min must be <= start time max")
}

Try / catch

ids, err := reader.FindTraceIDs(ctx, q)
if errors.Is(err, spanstore.ErrStartTimeMinGreaterThanMax) {
    return errors.New("invalid time range: min is after max")
}

Prevention

When it happens

Trigger: FindTraces/FindTraceIDs called with TraceQueryParams where p.StartTimeMax.Before(p.StartTimeMin) is true — e.g. swapped start/end timestamps, or a timezone/unit conversion bug that flips the range.

Common situations: A UI date-range picker emitting reversed boundaries; a client computing 'last N hours' with min/max assigned in the wrong order; cross-timezone clients sending local-time values misordered after conversion to UTC.

Related errors


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