{"record":{"id":"2b7b9afdd2ab1abb","repo":"jaegertracing/jaeger","slug":"invalid-version-q-expected-one-of-es7-es8-es9","errorCode":null,"errorMessage":"invalid version %q: expected one of es7, es8, es9, os1, os2, os3","messagePattern":"invalid version %q: expected one of es7, es8, es9, os1, os2, os3","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/elasticsearch/backend_version.go","lineNumber":73,"sourceCode":"\tlower := strings.ToLower(s)\n\tif len(lower) > 2 {\n\t\tprefix, digits := lower[:2], lower[2:]\n\t\tif major, err := strconv.Atoi(digits); err == nil {\n\t\t\tvar v BackendVersion\n\t\t\tswitch prefix {\n\t\t\tcase \"es\":\n\t\t\t\tv = BackendVersion(major)\n\t\t\tcase \"os\":\n\t\t\t\tv = BackendVersion(100 + major)\n\t\t\tdefault:\n\t\t\t\tv = 0\n\t\t\t}\n\t\t\tif v != 0 && IsSupportedVersion(uint(v)) {\n\t\t\t\treturn v, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn 0, fmt.Errorf(\"invalid version %q: expected one of es7, es8, es9, os1, os2, os3\", s)\n}\n\nfunc (v BackendVersion) String() string {\n\tswitch v {\n\tcase ElasticV7:\n\t\treturn \"Elasticsearch 7.x\"\n\tcase ElasticV8:\n\t\treturn \"Elasticsearch 8.x\"\n\tcase ElasticV9:\n\t\treturn \"Elasticsearch 9.x\"\n\tcase OpenSearch1:\n\t\treturn \"OpenSearch 1.x\"\n\tcase OpenSearch2:\n\t\treturn \"OpenSearch 2.x\"\n\tcase OpenSearch3:\n\t\treturn \"OpenSearch 3.x\"\n\tdefault:\n\t\treturn fmt.Sprintf(\"Unknown(%d)\", v)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/elasticsearch/backend_version.go#L55-L91","documentation":"ParseBackendVersion validates a user-supplied version string and fails when it doesn't map to a supported backend version (es7/es8/es9/os1/os2/os3). It is a pure input-validation error: the provided string was neither parseable as a numeric major version nor a recognized prefix.","triggerScenarios":"Passing a string like \"6\", \"es6\", \"opensearch\", \"7.x\", or \"\" to ParseBackendVersion; empty or whitespace-only input; supplying an Elasticsearch/OpenSearch major that Jaeger no longer supports (e.g. ES 6.x).","commonSituations":"Upgrading Jaeger while still running Elasticsearch 6; typos like 'ES7' (case/prefix mismatch); wiring an env var that is empty in the container; copying a version flag from an old deployment.","solutions":["Set the version string to one of: es7, es8, es9, os1, os2, os3 (or a plain supported major number like 7, 8, 9, 101, 102, 103 if the parser accepts numerics).","Use 0/auto-detect instead of an explicit version when the backend is reachable.","Verify the env var/flag feeding this value is actually populated and not empty in the runtime environment.","Upgrade your Elasticsearch/OpenSearch cluster to a supported major version if running an older one.","Check the release notes for newly dropped/added supported versions after upgrading Jaeger."],"exampleFix":"// before\nv, err := es.ParseBackendVersion(os.Getenv(\"ES_VERSION\")) // \"ES7\" -> error\n// after\nver := strings.ToLower(strings.TrimSpace(os.Getenv(\"ES_VERSION\")))\nif ver == \"\" {\n    ver = \"0\" // auto-detect\n}\nv, err := es.ParseBackendVersion(ver)","handlingStrategy":"validation","validationCode":"func validBackendVersion(s string) bool {\n    switch strings.ToLower(strings.TrimSpace(s)) {\n    case \"\", \"0\", \"es7\", \"es8\", \"es9\", \"os1\", \"os2\", \"os3\", \"7\", \"8\", \"9\", \"101\", \"102\", \"103\":\n        return true\n    }\n    return false\n}\n// call before ParseBackendVersion / before setting the env var","typeGuard":null,"tryCatchPattern":"v, err := es.ParseBackendVersion(raw)\nif err != nil {\n    return fmt.Errorf(\"%v: supported values are es7, es8, es9, os1, os2, os3 (or 0 to auto-detect)\", err)\n}","preventionTips":["Prefer Version=0 (auto-detect) unless you have a reason to pin.","Whitelist-validate any env var that feeds version parsing.","Keep a lookup table of supported versions next to your deployment config.","Re-check supported versions after every Jaeger upgrade."],"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"}