{"record":{"id":"536f2441bcd9a9b5","repo":"jaegertracing/jaeger","slug":"cannot-assign-unique-span-id-too-many-spans-in-th","errorCode":null,"errorMessage":"cannot assign unique span ID, too many spans in the trace","messagePattern":"cannot assign unique span ID, too many spans in the trace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/adjuster/spaniduniquifier.go","lineNumber":16,"sourceCode":"// Copyright (c) 2019 The Jaeger Authors.\n// Copyright (c) 2017 Uber Technologies, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\npackage adjuster\n\nimport (\n\t\"errors\"\n\n\t\"go.opentelemetry.io/collector/pdata/pcommon\"\n\t\"go.opentelemetry.io/collector/pdata/ptrace\"\n\n\t\"github.com/jaegertracing/jaeger/internal/jptrace\"\n)\n\nvar errTooManySpans = errors.New(\"cannot assign unique span ID, too many spans in the trace\")\n\n// DeduplicateClientServerSpanIDs returns an adjuster that changes span ids for server\n// spans (i.e. spans with tag: span.kind == server) if there is another\n// client span that shares the same span ID. This is needed to deal with\n// Zipkin-style clients that reuse the same span ID for both client and server\n// side of an RPC call. Jaeger UI expects all spans to have unique IDs.\n//\n// Any issues encountered during adjustment are recorded as warnings in the\n// span.\nfunc DeduplicateClientServerSpanIDs() Adjuster {\n\treturn Func(func(traces ptrace.Traces) {\n\t\tadjuster := spanIDDeduper{\n\t\t\tspansByID: make(map[pcommon.SpanID][]ptrace.Span),\n\t\t\tmaxUsedID: pcommon.NewSpanIDEmpty(),\n\t\t}\n\t\tadjuster.adjust(traces)\n\t})\n}","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/adjuster/spaniduniquifier.go#L1-L34","documentation":"errTypedConstant reports that a filter constant declares a type (via constantKind, by wire type) that this backend cannot route to a typed stored value, because all attribute values are indexed as keywords here. Honoring the declared type would silently match more than the user asked, so only untyped constants are served; the filter is rejected with tracestore.ErrFilterUnsupported. Typed attribute indexing (RFC 0015) is the roadmap fix.","triggerScenarios":"Submitting a filter whose constant is explicitly typed (e.g. an int64/float64/bool-typed attribute value) from untypedText, fieldText, or lengthOfTime, where the backend cannot route to a typed value in a keyword-only index.","commonSituations":"Clients that always attach wire types to attribute values (protobuf defaults) hitting a keyword-only Elasticsearch mapping; filters migrated from typed backends (Cassandra with typed columns) to Elasticsearch; RFC 0005 §5.4 typed matching expectations.","solutions":["Send the constant untyped (let the expression carry a plain string/untyped constant) so it matches the keyword-stored value.","Enable or migrate to typed attribute indexing (RFC 0015) if exact typed matching is required.","Catch errors.Is(err, tracestore.ErrFilterUnsupported) and surface that typed constants are not supported by this backend."],"exampleFix":"// before\nattr.status (typed int64) == 200\n// after\nattr.status == \"200\"","handlingStrategy":"validation","validationCode":"func untypedConstant(e expression.Expression) bool {\n    return constantKind(e) == \"untyped\" // only untyped constants are served\n}","typeGuard":null,"tryCatchPattern":"q, err := buildFilterQuery(...)\nif errors.Is(err, tracestore.ErrFilterUnsupported) && strings.Contains(err.Error(), \"untyped constants only\") {\n    // strip the declared type and resend the constant untyped\n}","preventionTips":["Send untyped (string) constants when targeting a keyword-only Elasticsearch backend.","Strip protobuf-assigned wire types before building filter constants.","Plan migration to typed attribute indexing (RFC 0015) for typed matching."],"tags":["query-filter","typed-constant","elasticsearch"],"backgroundTag":"typed-constant-unsupported","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}