{"record":{"id":"8dc161a3301c2588","repo":"openzipkin/zipkin","slug":"version-number-not-found-in-response-s","errorCode":null,"errorMessage":".version.number not found in response: %s","messagePattern":"\\.version\\.number not found in response: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java","lineNumber":88,"sourceCode":"          while (parser.nextToken() != null) {\n            if (parser.currentToken() == JsonToken.VALUE_STRING) {\n              switch (parser.currentName()) {\n                case \"distribution\":\n                  distribution = parser.getText();\n                  break;\n                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","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java#L70-L106","documentation":"BaseVersion.Parser.convert() throws IllegalArgumentException('.version.number not found in response: %s') when the root endpoint responded with JSON but no version.number field could be extracted (or parsing failed and was swallowed by the empty catch). The full body is included in the message for diagnosis.","triggerScenarios":"GET / returns valid JSON lacking a version.number field — e.g. a shield in front of ES, an ES fork with a different root payload, or an error JSON like {\"error\":...}.","commonSituations":"API-key/OAuth proxies returning a JSON error body with 200; ES plugins that replace the root handler; pointing at OpenSearch Serverless or other incompatible front-ends.","solutions":["curl the configured URL root and confirm the body contains version.number; fix routing/auth if it is an error payload.","Use a plain Elasticsearch 7+/OpenSearch endpoint supported by this Zipkin version.","If a proxy rewrites responses, exclude the ES host from rewriting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"JsonNode root = http.getJson(esUrl + \"/\");\nif (root.path(\"version\").path(\"number\").isMissingNode()) throw new IllegalStateException(\"No version.number at \" + esUrl + \": \" + root);","typeGuard":"static boolean looksLikeEsRoot(JsonNode n) { return n != null && n.path(\"version\").path(\"number\").isTextual(); }","tryCatchPattern":"catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\".version.number not found\")) logResponseBodyAndFixAuthOrRouting(); else throw e; }","preventionTips":["Verify auth returns real node info (not an error JSON) for the configured credentials.","Exclude the ES host from response-rewriting proxies."],"tags":["elasticsearch","opensearch","zipkin","version-detection","response-parsing"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}