{"record":{"id":"902f2ff636a03bf8","repo":"openzipkin/zipkin","slug":"invalid-version-number-s","errorCode":null,"errorMessage":"Invalid .version.number: %s","messagePattern":"Invalid \\.version\\.number: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java","lineNumber":94,"sourceCode":"                case \"number\":\n                  version = parser.getText();\n                  break;\n              }\n            }\n          }\n        }\n      } catch (RuntimeException | IOException possiblyParseException) {\n        // EmptyCatch ignored\n      }\n\n      if (version == null) {\n        throw new IllegalArgumentException(\n          \".version.number not found in response: \" + contentString.get());\n      }\n\n      Matcher matcher = REGEX.matcher(version);\n      if (!matcher.matches()) {\n        throw new IllegalArgumentException(\"Invalid .version.number: \" + version);\n      }\n\n      try {\n        int major = Integer.parseInt(matcher.group(1));\n        int minor = Integer.parseInt(matcher.group(2));\n        if (\"opensearch\".equalsIgnoreCase(distribution)) {\n          return new OpensearchVersion(major, minor);\n        } else {\n          return new ElasticsearchVersion(major, minor);\n        }\n      } catch (NumberFormatException e) {\n        throw new IllegalArgumentException(\"Invalid .version.number: \" + version\n          + \", for .version.distribution:\" + distribution);\n      }\n    }\n  }\n}\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java#L76-L112","documentation":"BaseVersion.Parser.convert() throws IllegalArgumentException('Invalid .version.number') when the version.number string does not match the '(\\d+)\\.(\\d+).*' regex or its major/minor groups are not parseable integers. Zipkin needs a numeric major.minor to pick behavior per server version, so unrecognized formats are rejected.","triggerScenarios":"A server reporting version.number like 'v8.1', 'latest', '8.x', or otherwise lacking numeric major.minor components.","commonSituations":"Elasticsearch/OpenSearch forks, spoofed version strings behind proxies, or pre-release builds with nonstandard version metadata.","solutions":["Check the reported version.number via curl and use a server that reports a standard semver-like value (e.g. '7.17.9').","Upgrade or replace the fork/proxy that mangles version.number.","If running a custom build, ensure its node info exposes a numeric version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String v = http.getJson(esUrl + \"/\").path(\"version\").path(\"number\").asText(null);\nif (v == null || !v.matches(\"\\\\d+\\\\.\\\\d+.*\")) throw new IllegalStateException(\"Unrecognized version.number '\" + v + \"'; use standard ES/OpenSearch\");","typeGuard":"static boolean isStandardVersionNumber(String v) { return v != null && v.matches(\"\\\\d+\\\\.\\\\d+.*\"); }","tryCatchPattern":"catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Invalid .version.number\")) failWithServerCompatibilityHint(e.getMessage()); else throw e; }","preventionTips":["Run stock Elasticsearch 7+/OpenSearch builds; avoid forks with custom version strings.","Pin server images to released versions in all environments."],"tags":["elasticsearch","opensearch","zipkin","version-parsing","compatibility"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}