{"record":{"id":"a65120c8bcb4f3bb","repo":"jaegertracing/jaeger","slug":"s-w-a65120","errorCode":null,"errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v1/cassandra/spanstore/writer.go","lineNumber":280,"sourceCode":"\t\tvar js json.RawMessage\n\t\t// poor man's string-is-a-json check shortcircuits full unmarshalling\n\t\treturn strings.HasPrefix(s, \"{\") && json.Unmarshal([]byte(s), &js) == nil\n\t}\n\n\treturn len(tag.TagKey) < maximumTagKeyOrValueSize &&\n\t\tlen(tag.TagValue) < maximumTagKeyOrValueSize &&\n\t\tutf8.ValidString(tag.TagValue) &&\n\t\tutf8.ValidString(tag.TagKey) &&\n\t\t!isJSON(tag.TagValue)\n}\n\nfunc (*SpanWriter) logError(span *dbmodel.Span, err error, msg string, logger *zap.Logger) error {\n\tlogger.\n\t\tWith(zap.String(\"trace_id\", span.TraceID.String())).\n\t\tWith(zap.Int64(\"span_id\", span.SpanID)).\n\t\tWith(zap.Error(err)).\n\t\tError(msg)\n\treturn fmt.Errorf(\"%s: %w\", msg, err)\n}\n\nfunc (s *SpanWriter) saveServiceNameAndOperationName(operation dbmodel.Operation) error {\n\tif err := s.serviceNamesWriter(operation.ServiceName); err != nil {\n\t\treturn err\n\t}\n\treturn s.operationNamesWriter(operation)\n}\n","sourceCodeStart":262,"sourceCodeEnd":289,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v1/cassandra/spanstore/writer.go#L262-L289","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := writer.WriteSpan(ctx, span); err != nil {\n    // err embeds the failing step ('failed to write index', etc.) plus the\n    // Cassandra cause; log spanID/traceID and retry or drop per policy\n    logger.Error(\"span write failed\", zap.Error(err))\n}","preventionTips":["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."],"tags":["cassandra","write","storage","indexing"],"backgroundTag":"storage-write-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}