{"record":{"id":"3ec55ae2a1016407","repo":"jaegertracing/jaeger","slug":"failed-to-resolve-backend-version-w","errorCode":null,"errorMessage":"failed to resolve backend version: %w","messagePattern":"failed to resolve backend version: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/esclient/client.go","lineNumber":66,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttransport, err := newRawClient(ctx, base, rawClientOptions{\n\t\tservers:             c.Servers,\n\t\tcompressRequestBody: c.HTTPCompression,\n\t\tdiscoverNodes:       c.Sniffing.Enabled,\n\t\tlogLevel:            c.LogLevel,\n\t\tlogger:              logger,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := &Client{transport: transport, timeout: c.QueryTimeout}\n\t// Honor an explicit c.Version, otherwise probe the cluster once via the\n\t// low-level ping. Both planes share es.ResolveBackendVersion.\n\tversion, err := es.ResolveBackendVersion(ctx, c.Version, client.ping)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to resolve backend version: %w\", err)\n\t}\n\tclient.version = version\n\treturn client, nil\n}\n\n// Close releases the client's pooled idle connections. It is safe to call on a nil\n// *Client (a factory that failed to construct one). The transport has no background\n// goroutines — node discovery (sniffing), when enabled, runs once at startup rather\n// than on a schedule — so there is nothing else to stop.\nfunc (c *Client) Close() error {\n\tif c != nil && c.transport != nil {\n\t\tc.transport.close()\n\t}\n\treturn nil\n}\n\n// TestsOnlyBackendVersion returns the backend version resolved at construction.\n// It exists ONLY for integration tests that must branch on the backend flavor or","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/esclient/client.go#L48-L84","documentation":"NewClient must know the Elasticsearch backend version to pick correct APIs. It honors an explicit configured Version or probes the cluster once via a low-level ping (ResolveBackendVersion); if the configured version is invalid or the ping fails, the error is wrapped with this message and client creation fails.","triggerScenarios":"Calling NewClient when c.Version is set to an unparsable value, or when the cluster ping fails (unreachable host, TLS/auth failure, no healthy nodes).","commonSituations":"Typo in the version config (e.g. 'v7' instead of a parseable version); ES down or behind a proxy that blocks the ping endpoint; wrong TLS certificates; DNS/network issues in Kubernetes.","solutions":["Check network/TLS/auth so the cluster ping succeeds (curl the ES root endpoint from the Jaeger host)","Set a valid explicit version in the config to skip probing if probing is unwanted","Verify ES is running and the configured addresses are correct","Inspect the wrapped inner error for the root cause (dial failure vs parse failure)"],"exampleFix":"// before\nversion: v7   # unparsable\n// after\nversion: 7.17.0","handlingStrategy":"try-catch","validationCode":"// preflight: confirm the cluster answers the root endpoint\nresp, err := http.Get(esURL)\nif err != nil {\n    return fmt.Errorf(\"ES unreachable before client init: %w\", err)\n}\nresp.Body.Close()","typeGuard":null,"tryCatchPattern":"client, err := esclient.NewClient(ctx, cfg, transport, logger)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to resolve backend version\") {\n        logger.Error(\"ES version probe failed; check connectivity/TLS/auth or set an explicit version\", \"err\", err)\n    }\n    return err\n}","preventionTips":["Set an explicit, valid version in config to skip probing","Include ES connectivity checks in readiness probes","Keep TLS certs and credentials current"],"tags":["elasticsearch","client-init","version-detection","network"],"backgroundTag":"backend-version-resolution-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}