jaegertracing/jaeger · error
could not find aggregation of traceIDs
Error message
could not find aggregation of traceIDs
What it means
ErrUnableToFindTraceIDAggregation is a sentinel error returned by findTraceIDsFromQuery when the Elasticsearch search response does not contain the expected terms aggregation of trace IDs. The trace-ID search relies on a named aggregation; if the response lacks it (server-side query shape changed, mapping mismatch, or aggregation dropped), the reader cannot extract trace IDs and fails with this error.
Source
Thrown at internal/storage/v2/elasticsearch/tracestore/core/reader.go:68
DawnOfTimeSpanAge = time.Hour * 24 * 365 * 50
)
var (
// 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")
// ErrStartAndEndTimeNotSet occurs when start time and end time are not set
ErrStartAndEndTimeNotSet = errors.New("start and End Time must be set")
// ErrUnableToFindTraceIDAggregation occurs when an aggregation query for TraceIDs fail.
ErrUnableToFindTraceIDAggregation = errors.New("could not find aggregation of traceIDs")
defaultMaxDuration = model.DurationAsMicroseconds(time.Hour * 24)
objectTagFieldList = []string{objectTagsField, objectProcessTagsField}
nestedTagFieldList = []string{nestedTagsField, nestedProcessTagsField, nestedLogFieldsField}
_ Reader = (*SpanReader)(nil) // check API conformance
)
// Time-range design (referenced as "timeRangeDesign" in comments below):
//
// There are two read operations with different time-range semantics:
//
// 1. FindTraceIDs: the user always supplies [StartTimeMin, StartTimeMax]. No adjustment needed.
//
// 2. GetTraces (by trace ID): no time range is known. The reader uses [now-maxSpanAge, now].
// - Periodic indices: maxSpanAge should match data retention (e.g., 7d). ReadTargets generatesView on GitHub (pinned to 806f444784)
Solutions
- Verify the Elasticsearch/OpenSearch server version is supported by this Jaeger version.
- Log/inspect the raw response to confirm whether aggregations were returned at all.
- Check index templates and index mappings are up to date (re-run Jaeger init for your storage).
- Confirm no proxy/security layer is stripping the aggregations section of the response.
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check server compatibility before querying:
info, err := esClient.Info()
if err != nil || !supportedVersion(info.Version.Number) { /* fail fast */ } Try / catch
ids, err := reader.FindTraceIDs(ctx, query)
if errors.Is(err, core.ErrUnableToFindTraceIDAggregation) {
log.Printf("ES response missing traceID aggregation; check version/mappings")
return nil, err
} Prevention
- Keep Jaeger and the Elasticsearch/OpenSearch cluster versions aligned with the support matrix.
- Re-run storage init after version upgrades so index templates/mappings are current.
- Monitor responses for missing aggregations with a canary FindTraceIDs health check.
When it happens
Trigger: Calling reader.FindTraceIDs where the ES response comes back with Aggregations that do not include the traceID terms aggregation — e.g. after an upgrade where the query/aggregation name changed, a proxy stripping aggregations, or an incompatible Elasticsearch/OpenSearch server version.
Common situations: Version skew between Jaeger and the Elasticsearch/OpenSearch cluster; custom index templates or security settings altering aggregation behavior; running against a proxy that rewrites responses.
Related errors
- could not find aggregation of
- nil search response
- root span top-hit missing _source
- aggregation bucket has a non-string key: %w
- failed to convert aggregations to metrics: %w
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/5b46c26bf48eeb8e.
Report an issue: GitHub.