{"record":{"id":"b734eacb44f517cf","repo":"jaegertracing/jaeger","slug":"failed-to-get-trace-w","errorCode":null,"errorMessage":"failed to get trace: %w","messagePattern":"failed to get trace: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/mcptools/internal/handlers/get_critical_path.go","lineNumber":66,"sourceCode":"\tinput types.GetCriticalPathInput,\n) (*mcp.CallToolResult, types.GetCriticalPathOutput, error) {\n\t// Build query parameters (includes validation)\n\tparams, err := h.buildQuery(input)\n\tif err != nil {\n\t\treturn nil, types.GetCriticalPathOutput{}, err\n\t}\n\n\ttracesIter := h.queryService.GetTraces(ctx, params)\n\n\t// Wrap with AggregateTraces to ensure each ptrace.Traces contains a complete trace\n\taggregatedIter := jptrace.AggregateTraces(tracesIter)\n\n\tvar trace ptrace.Traces\n\ttraceFound := false\n\n\tfor t, err := range aggregatedIter {\n\t\tif err != nil {\n\t\t\treturn nil, types.GetCriticalPathOutput{}, fmt.Errorf(\"failed to get trace: %w\", err)\n\t\t}\n\n\t\ttraceFound = true\n\t\ttrace = t\n\t\tbreak // We expect only one trace since we're querying by a single trace ID\n\t}\n\n\tif !traceFound {\n\t\treturn nil, types.GetCriticalPathOutput{}, errors.New(\"trace not found\")\n\t}\n\n\t// Compute critical path\n\tcriticalPathSections, err := criticalpath.ComputeCriticalPathFromTraces(trace)\n\tif err != nil {\n\t\treturn nil, types.GetCriticalPathOutput{}, fmt.Errorf(\"failed to compute critical path: %w\", err)\n\t}\n\n\t// Build output","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/mcptools/internal/handlers/get_critical_path.go#L48-L84","documentation":"The get_critical_path MCP tool handler iterates the trace-store result for the requested trace ID; any iteration error from the query service/storage is wrapped as \"failed to get trace: <cause>\". This surfaces storage-level failures to the MCP caller instead of returning an empty result.","triggerScenarios":"handle() calls the query service for a single trace ID and the returned iterator yields a non-nil error (storage backend failure, query service RPC error).","commonSituations":"Storage backend (Cassandra/ES/ClickHouse) down or timing out; query service dependency misconfigured; trace data unavailable due to retention or backend partial outage.","solutions":["Inspect the wrapped cause and jaeger-query logs to identify the storage/RPC failure.","Verify the storage backend is healthy and reachable from jaeger-query.","Retry the tool call once backend health is restored.","Confirm the query service dependency configuration (remote storage / GRPC endpoint) is correct."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := handler.Handle(ctx, input)\nif err != nil && strings.Contains(err.Error(), \"failed to get trace:\") {\n    // wrapped storage/query-service cause; log and retry after backend health check\n    if storageHealthy() {\n        out, err = handler.Handle(ctx, input)\n    }\n}","preventionTips":["Monitor storage backend health and alerts before relying on MCP trace tools.","Verify jaeger-query's storage dependency configuration on deploy.","Set sane query timeouts so slow backends fail fast with a clear cause."],"tags":["storage","mcp","query-service"],"backgroundTag":"storage-backend-error","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}