{"record":{"id":"108fc07d66186fb6","repo":"jaegertracing/jaeger","slug":"unsupported-version-d-set-0-to-auto-detect-or-u","errorCode":null,"errorMessage":"unsupported version %d: set 0 to auto-detect, or use 7/8/9 (Elasticsearch) or 101/102/103 (OpenSearch 1/2/3)","messagePattern":"unsupported version (.+?): set 0 to auto-detect, or use 7/8/9 \\(Elasticsearch\\) or 101/102/103 \\(OpenSearch 1/2/3\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/config/config.go","lineNumber":425,"sourceCode":"\n\t// from params\n\tif c.Tags.Include != \"\" {\n\t\ttags = append(tags, strings.Split(c.Tags.Include, \",\")...)\n\t}\n\n\treturn tags, nil\n}\n\nfunc (c *Configuration) Validate() error {\n\t_, err := govalidator.ValidateStruct(c)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// A non-zero Version is an explicit backend override; reject unsupported\n\t// values so they don't silently become an Unknown version. 0 means auto-detect.\n\tif c.Version != 0 && !es.IsSupportedVersion(c.Version) {\n\t\treturn fmt.Errorf(\"unsupported version %d: set 0 to auto-detect, or use 7/8/9 (Elasticsearch) or 101/102/103 (OpenSearch 1/2/3)\", c.Version)\n\t}\n\n\t// Ensure at most one auth method is configured (they all set the Authorization header).\n\tvar authCount int\n\tif c.Authentication.BasicAuthentication.HasValue() {\n\t\tauthCount++\n\t}\n\tif c.Authentication.BearerTokenAuth.HasValue() {\n\t\tauthCount++\n\t}\n\tif c.Authentication.APIKeyAuth.HasValue() {\n\t\tauthCount++\n\t}\n\tif authCount > 1 {\n\t\treturn errors.New(\"at most one authentication method (basic, bearer_token, api_key) may be configured; all three use the Authorization header\")\n\t}\n\n\t// Reject options orphaned when the olivere client stack was retired (#8982):","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/config/config.go#L407-L443","documentation":"Configuration.Validate rejects a non-zero Version that is not one of the supported Elasticsearch (7/8/9) or OpenSearch (101/102/103) backend versions. Version 0 means auto-detect and is always allowed; any other integer would silently become Unknown, so it is rejected early at config-validation time.","triggerScenarios":"Setting SPAN_STORAGE_TYPE=elasticsearch with an explicit version flag/env like ES_VERSION=6, 10, 200, or a non-numeric-ish value coerced to an unexpected integer; programmatically constructing config.Configuration{Version: N} with an unsupported N.","commonSituations":"Migrating from an older Jaeger that supported ES 6.x; users setting Version equal to their full OpenSearch version (e.g. 2.11 -> 2) instead of the OpenSearch code 102; fat-fingering 8 as 80.","solutions":["Set Version to 0 (auto-detect) or one of 7, 8, 9 (Elasticsearch) / 101, 102, 103 (OpenSearch 1/2/3).","For OpenSearch, use the special codes (101/102/103), not the plain major number (2, not 2.11).","If running an unsupported ES major (6 or 10+), upgrade the cluster or downgrade Jaeger to a compatible release.","Check the env var/flag feeding Version for stale or wrong values (e.g. left over from a previous deployment)."],"exampleFix":"// before\ncfg := esconfig.Configuration{Version: 6}\n// after\ncfg := esconfig.Configuration{Version: 7} // or 0 for auto-detect; OpenSearch 2.x -> 102","handlingStrategy":"validation","validationCode":"func validExplicitVersion(v int) bool {\n    switch v {\n    case 0, 7, 8, 9, 101, 102, 103:\n        return true\n    }\n    return false\n}\n// run before constructing/validating esconfig.Configuration","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"unsupported version\") {\n        log.Printf(\"fix Version setting: use 0 (auto), 7/8/9 for Elasticsearch, or 101/102/103 for OpenSearch\")\n    }\n    return err\n}","preventionTips":["Use 0 (auto-detect) unless pinning deliberately.","Remember OpenSearch uses codes 101/102/103, not plain major numbers.","Sanitize the env var/flag feeding Version.","Re-validate configs after Jaeger upgrades change the supported set."],"tags":["elasticsearch","opensearch","configuration","version-validation"],"backgroundTag":"unsupported-backend-version","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}