jaegertracing/jaeger · error
%s: %w
Error message
%s: %w
What it means
logError is the SpanWriter's uniform error funnel: it logs the failed write step (msg) with trace ID, span ID and the underlying error, then returns fmt.Errorf("%s: %w", msg, err). Callers (writeSpanToDB, writeIndexes, indexByTags) pass messages like 'failed to save service name' or 'failed to write index', so the surfaced error combines the step name with the Cassandra cause.
Source
Thrown at internal/storage/v1/cassandra/spanstore/writer.go:280
var js json.RawMessage
// poor man's string-is-a-json check shortcircuits full unmarshalling
return strings.HasPrefix(s, "{") && json.Unmarshal([]byte(s), &js) == nil
}
return len(tag.TagKey) < maximumTagKeyOrValueSize &&
len(tag.TagValue) < maximumTagKeyOrValueSize &&
utf8.ValidString(tag.TagValue) &&
utf8.ValidString(tag.TagKey) &&
!isJSON(tag.TagValue)
}
func (*SpanWriter) logError(span *dbmodel.Span, err error, msg string, logger *zap.Logger) error {
logger.
With(zap.String("trace_id", span.TraceID.String())).
With(zap.Int64("span_id", span.SpanID)).
With(zap.Error(err)).
Error(msg)
return fmt.Errorf("%s: %w", msg, err)
}
func (s *SpanWriter) saveServiceNameAndOperationName(operation dbmodel.Operation) error {
if err := s.serviceNamesWriter(operation.ServiceName); err != nil {
return err
}
return s.operationNamesWriter(operation)
}
View on GitHub (pinned to 806f444784)
Solutions
- Read the logged msg + wrapped error to identify the failing step and root Cassandra cause.
- Retry the span write; Jaeger writes are idempotent for the same span/ID.
- Address cluster write health: timeouts, replication, nodetool repair.
- Check for oversized spans (huge tag payloads, max_trace/archive limits) and adjust writer config or data.
Defensive patterns
Strategy: try-catch
Try / catch
if err := writer.WriteSpan(ctx, span); err != nil {
// err embeds the failing step ('failed to write index', etc.) plus the
// Cassandra cause; log spanID/traceID and retry or drop per policy
logger.Error("span write failed", zap.Error(err))
} Prevention
- Watch writer error logs; the msg prefix names the failing write step.
- Keep Cassandra write capacity ahead of ingestion rate.
- Limit tag payload sizes to avoid oversized index writes.
- Ensure the keyspace schema matches the deployed Jaeger version.
When it happens
Trigger: Any span write path failing: inserting into traces, writing duration/service-name/operation indexes or tag indexes when Cassandra rejects or times out the write — write timeout, unavailable, consistency failure, or oversized data.
Common situations: Cassandra write timeouts under load; batch of index writes exceeding limits; keyspace misconfiguration on a fresh deployment; too many tags creating large rows; node outages.
Related errors
- invalid version
- failed to Exec query '%s': %w
- failed to acquire resource lock due to cassandra error: %w
- unknown column for position: %q
- unsupported schema version: %v
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/a65120c8bcb4f3bb.
Report an issue: GitHub.