jaegertracing/jaeger · error

invalid version format: %s

Error message

invalid version format: %s

What it means

ResolveBackendVersion parses the major version component returned by the backend's ping/info endpoint and fails when that string is not a valid integer. Unlike ParseBackendVersion, the invalid input comes from the server's reported version number, so this usually indicates a nonstandard or proxied backend response.

Source

Thrown at internal/storage/elasticsearch/backend_version.go:134

// data-plane and admin-plane client builders. It returns the configured version
// when it is non-zero (an explicit override, honored without a network call);
// otherwise it calls ping once and derives the version from the response.
func ResolveBackendVersion(ctx context.Context, configured uint, ping func(context.Context) (PingResult, error)) (BackendVersion, error) {
	if configured != 0 {
		return BackendVersion(configured), nil
	}
	result, err := ping(ctx)
	if err != nil {
		return 0, err
	}
	if result.VersionNumber == "" {
		return 0, errors.New("backend returned an empty version number")
	}
	// Parse the whole major component (up to the first dot), not just the first
	// byte — otherwise "10.x" would be misread as major 1.
	majorVersion, err := strconv.Atoi(strings.Split(result.VersionNumber, ".")[0])
	if err != nil {
		return 0, fmt.Errorf("invalid version format: %s", result.VersionNumber)
	}
	return DetectBackendVersion(result.TagLine, majorVersion), nil
}

// DetectBackendVersion determines the BackendVersion from the ping response.
func DetectBackendVersion(tagLine string, majorVersion int) BackendVersion {
	if strings.Contains(tagLine, "OpenSearch") {
		switch majorVersion {
		case 1:
			return OpenSearch1
		case 2:
			return OpenSearch2
		default:
			return OpenSearch3
		}
	}
	switch majorVersion {
	case 7:

View on GitHub (pinned to 806f444784)

Solutions

  1. Verify the configured URL points directly at the ES/OpenSearch root endpoint (not a proxy or UI route) and that GET / returns JSON with version.number.
  2. Curl the endpoint and inspect version.number; fix the address or proxy passthrough if it isn't a numeric major like '7.17.9'.
  3. Use an explicit config Version (7/8/9/101/102/103) to bypass auto-detection if the backend reports a nonstandard string.
  4. Upgrade/downgrade the managed service or fork if it reports an incompatible version format.
  5. Check that no auth redirect is converting the info request into an HTML login page.

Example fix

# diagnose
curl -s http://es:9200/ | jq .version.number   # must be like "7.17.9"
// before (auto-detect fails)
config := esconfig.Configuration{Servers: []string{"http://es:9200"}}
// after
config := esconfig.Configuration{Servers: []string{"http://es:9200"}, Version: 7}
Defensive patterns

Strategy: validation

Validate before calling

resp, err := http.Get(serverURL)
if err == nil {
    var info struct{ Version struct{ Number string `json:"number"` } `json:"version"` }
    json.NewDecoder(resp.Body).Decode(&info)
    if _, cerr := strconv.Atoi(strings.Split(info.Version.Number, ".")[0]); cerr != nil {
        log.Printf("backend reports non-numeric version %q; fix URL or pin explicit Version", info.Version.Number)
    }
}

Try / catch

v, err := es.ResolveBackendVersion(client)
if err != nil {
    if strings.Contains(err.Error(), "invalid version format") {
        // fall back to explicit version instead of auto-detect
        return configuredVersion // e.g. 7
    }
    return err
}

Prevention

When it happens

Trigger: Calling ResolveBackendVersion against a backend whose info endpoint returns a VersionNumber that doesn't start with an integer (e.g. a proxy/mocked endpoint returning "unknown", "7.x-SNAPSHOT", or HTML from an incorrect URL).

Common situations: Pointing Jaeger at a reverse proxy that intercepts / and returns HTML; OpenSearch forks or managed services reporting unusual version strings; connecting to the wrong port/service that answers with something other than ES/OS.

Related errors


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