{"record":{"id":"a73930a594e8d03a","repo":"jaegertracing/jaeger","slug":"error-reading-traces-from-storage-w","errorCode":null,"errorMessage":"error reading traces from storage: %w","messagePattern":"error reading traces from storage: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v1/cassandra/spanstore/reader.go","lineNumber":207,"sourceCode":"\t\t\tTraceID:       traceIDFromSpan,\n\t\t\tSpanID:        spanID,\n\t\t\tParentID:      parentID,\n\t\t\tOperationName: operationName,\n\t\t\tFlags:         flags,\n\t\t\tStartTime:     startTime,\n\t\t\tDuration:      duration,\n\t\t\tTags:          tags,\n\t\t\tLogs:          logs,\n\t\t\tRefs:          refs,\n\t\t\tProcess:       dbProcess,\n\t\t\tServiceName:   dbProcess.ServiceName,\n\t\t})\n\t}\n\n\terr := i.Close()\n\ts.metrics.readTraces.Emit(err, time.Since(start))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading traces from storage: %w\", err)\n\t}\n\treturn spans, nil\n}\n\n// GetTrace takes a traceID and returns the spans associated with that traceID\nfunc (s *SpanReader) GetTrace(ctx context.Context, traceID dbmodel.TraceID) ([]dbmodel.Span, error) {\n\treturn s.readTrace(ctx, traceID)\n}\n\nfunc validateQuery(p *tracestore.TraceQueryParams) error {\n\tif p == nil {\n\t\treturn ErrMalformedRequestObject\n\t}\n\t// Every index is keyed by service name, so a query without one has no partition to\n\t// read: queryByService would run with an empty partition key and return zero rows,\n\t// which is indistinguishable from \"no matching traces\". Refusing it says what is\n\t// actually true (RFC 0013 §3.3); the query service normally rejects such a query\n\t// first, from the capability this reader declares.","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v1/cassandra/spanstore/reader.go#L189-L225","documentation":"readTraceInSpan streams all spans of one trace from the traces table; after the iteration completes it closes the iterator and, if the driver reported an error during the result set streaming, wraps it with this message and emits a readTraces error metric. The caller gets a partial-failure indication instead of a silently truncated trace.","triggerScenarios":"GetTrace / readTrace on SpanReader where the Cassandra scan of the trace's span rows fails mid-iteration — coordinator timeout, node down, or connection reset while paging through the trace's rows.","commonSituations":"Very large traces (tens of thousands of spans) exceeding read timeouts; Cassandra node loss during paging; network instability; heavy cluster load.","solutions":["Retry GetTrace; transient page-level failures often succeed on a second attempt.","Check the wrapped gocql error and Cassandra logs to distinguish timeouts from topology issues.","Increase client read timeout / tune paging size for large traces.","Run nodetool repair / check cluster health if failures correlate with specific nodes."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"trace, err := reader.GetTrace(ctx, traceID)\nif err != nil {\n    if strings.Contains(err.Error(), \"error reading traces from storage\") {\n        // transient paging failure: backoff and retry once\n    }\n    return err\n}","preventionTips":["Increase read timeouts if traces are very large.","Monitor readTraces error metrics emitted by the reader.","Keep cluster nodes healthy; repair after node loss.","Cap span counts per trace upstream to bound page sizes."],"tags":["cassandra","storage","trace-lookup","iterator"],"backgroundTag":"storage-read-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}