{"record":{"id":"5b46c26bf48eeb8e","repo":"jaegertracing/jaeger","slug":"could-not-find-aggregation-of-traceids-5b46c2","errorCode":null,"errorMessage":"could not find aggregation of traceIDs","messagePattern":"could not find aggregation of traceIDs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v2/elasticsearch/tracestore/core/reader.go","lineNumber":68,"sourceCode":"\n\tDawnOfTimeSpanAge = time.Hour * 24 * 365 * 50\n)\n\nvar (\n\t// ErrStartTimeMinGreaterThanMax occurs when start time min is above start time max\n\tErrStartTimeMinGreaterThanMax = errors.New(\"start Time Minimum is above Maximum\")\n\n\t// ErrDurationMinGreaterThanMax occurs when duration min is above duration max\n\tErrDurationMinGreaterThanMax = errors.New(\"duration Minimum is above Maximum\")\n\n\t// ErrMalformedRequestObject occurs when a request object is nil\n\tErrMalformedRequestObject = errors.New(\"malformed request object\")\n\n\t// ErrStartAndEndTimeNotSet occurs when start time and end time are not set\n\tErrStartAndEndTimeNotSet = errors.New(\"start and End Time must be set\")\n\n\t// ErrUnableToFindTraceIDAggregation occurs when an aggregation query for TraceIDs fail.\n\tErrUnableToFindTraceIDAggregation = errors.New(\"could not find aggregation of traceIDs\")\n\n\tdefaultMaxDuration = model.DurationAsMicroseconds(time.Hour * 24)\n\n\tobjectTagFieldList = []string{objectTagsField, objectProcessTagsField}\n\n\tnestedTagFieldList = []string{nestedTagsField, nestedProcessTagsField, nestedLogFieldsField}\n\n\t_ Reader = (*SpanReader)(nil) // check API conformance\n)\n\n// Time-range design (referenced as \"timeRangeDesign\" in comments below):\n//\n// There are two read operations with different time-range semantics:\n//\n//  1. FindTraceIDs: the user always supplies [StartTimeMin, StartTimeMax]. No adjustment needed.\n//\n//  2. GetTraces (by trace ID): no time range is known. The reader uses [now-maxSpanAge, now].\n//     - Periodic indices: maxSpanAge should match data retention (e.g., 7d). ReadTargets generates","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v2/elasticsearch/tracestore/core/reader.go#L50-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check server compatibility before querying:\ninfo, err := esClient.Info()\nif err != nil || !supportedVersion(info.Version.Number) { /* fail fast */ }","typeGuard":null,"tryCatchPattern":"ids, err := reader.FindTraceIDs(ctx, query)\nif errors.Is(err, core.ErrUnableToFindTraceIDAggregation) {\n    log.Printf(\"ES response missing traceID aggregation; check version/mappings\")\n    return nil, err\n}","preventionTips":["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."],"tags":["elasticsearch","aggregation","response-parsing"],"backgroundTag":"missing-aggregation-in-response","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}