jaegertracing/jaeger · error

error reading traces from storage: %w

Error message

error reading traces from storage: %w

What it means

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.

Source

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

			TraceID:       traceIDFromSpan,
			SpanID:        spanID,
			ParentID:      parentID,
			OperationName: operationName,
			Flags:         flags,
			StartTime:     startTime,
			Duration:      duration,
			Tags:          tags,
			Logs:          logs,
			Refs:          refs,
			Process:       dbProcess,
			ServiceName:   dbProcess.ServiceName,
		})
	}

	err := i.Close()
	s.metrics.readTraces.Emit(err, time.Since(start))
	if err != nil {
		return nil, fmt.Errorf("error reading traces from storage: %w", err)
	}
	return spans, nil
}

// GetTrace takes a traceID and returns the spans associated with that traceID
func (s *SpanReader) GetTrace(ctx context.Context, traceID dbmodel.TraceID) ([]dbmodel.Span, error) {
	return s.readTrace(ctx, traceID)
}

func validateQuery(p *tracestore.TraceQueryParams) error {
	if p == nil {
		return ErrMalformedRequestObject
	}
	// Every index is keyed by service name, so a query without one has no partition to
	// read: queryByService would run with an empty partition key and return zero rows,
	// which is indistinguishable from "no matching traces". Refusing it says what is
	// actually true (RFC 0013 §3.3); the query service normally rejects such a query
	// first, from the capability this reader declares.

View on GitHub (pinned to 806f444784)

Solutions

  1. Retry GetTrace; transient page-level failures often succeed on a second attempt.
  2. Check the wrapped gocql error and Cassandra logs to distinguish timeouts from topology issues.
  3. Increase client read timeout / tune paging size for large traces.
  4. Run nodetool repair / check cluster health if failures correlate with specific nodes.
Defensive patterns

Strategy: retry

Try / catch

trace, err := reader.GetTrace(ctx, traceID)
if err != nil {
    if strings.Contains(err.Error(), "error reading traces from storage") {
        // transient paging failure: backoff and retry once
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: Very large traces (tens of thousands of spans) exceeding read timeouts; Cassandra node loss during paging; network instability; heavy cluster load.

Related errors


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