{"record":{"id":"c53fdbd80223f668","repo":"openzipkin/zipkin","slug":"no-content-reading-elasticsearch-opensearch-versio","errorCode":null,"errorMessage":"No content reading Elasticsearch/OpenSearch version","messagePattern":"No content reading Elasticsearch/OpenSearch version","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java","lineNumber":59,"sourceCode":"    return Parser.INSTANCE.get(http);\n  }\n\n  /**\n   * Does this version of Elasticsearch / OpenSearch still support mapping types?\n   * @return \"true\" if mapping types are supported, \"false\" otherwise\n   */\n  public abstract boolean supportsTypes();\n  \n  enum Parser implements HttpCall.BodyConverter<BaseVersion> {\n    INSTANCE;\n\n    final Pattern REGEX = Pattern.compile(\"(\\\\d+)\\\\.(\\\\d+).*\");\n\n    BaseVersion get(HttpCall.Factory callFactory) throws IOException {\n      AggregatedHttpRequest getNode = AggregatedHttpRequest.of(HttpMethod.GET, \"/\");\n      BaseVersion version = callFactory.newCall(getNode, this, \"get-node\").execute();\n      if (version == null) {\n        throw new IllegalArgumentException(\"No content reading Elasticsearch/OpenSearch version\");\n      }\n      return version;\n    }\n\n    @Override\n    public BaseVersion convert(JsonParser parser, Supplier<String> contentString) {\n      String version = null;\n      String distribution = null;\n      try {\n        if (enterPath(parser, \"version\") != null) {\n          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();","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java#L41-L77","documentation":"BaseVersion.Parser.get() throws IllegalArgumentException('No content reading Elasticsearch/OpenSearch version') when the HTTP GET / call to the ES/OpenSearch node returns a body that converts to a null BaseVersion — i.e. the response had no usable content for version detection.","triggerScenarios":"Pointing Zipkin's ES storage at a URL that returns an empty or non-JSON root response: a proxy, a non-ES service, or an endpoint requiring auth that returns an empty 200/3xx body.","commonSituations":"ES_HTTP_URL misconfigured to a gateway/ingress; auth plugin returning an empty body; ES behind a load balancer whose health page answers instead.","solutions":["Verify ES_HTTP_URL points at a real Elasticsearch/OpenSearch HTTP endpoint (curl $ES_HTTP_URL/ should return JSON with version.number).","Fix proxy/LB routing or auth so the root endpoint returns the node info JSON.","Remove trailing paths so the client hits '/' of the correct host."],"exampleFix":"# before\nES_HTTP_URL=https://gateway.internal/api/traces\n\n# after\nES_HTTP_URL=https://es.internal:9200","handlingStrategy":"validation","validationCode":"// Probe the endpoint before building the ES storage\nHttpResponse resp = http.get(esUrl + \"/\");\nif (!resp.isJson() || resp.bodyJson().get(\"version\") == null) throw new IllegalStateException(esUrl + \" is not an Elasticsearch/OpenSearch endpoint\");","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { if (e.getMessage().contains(\"No content reading\")) failStartupWithEsUrlHint(); else throw e; }","preventionTips":["Smoke-test `curl $ES_HTTP_URL/` returns ES node-info JSON before deploying.","Point ES_HTTP_URL directly at ES/OpenSearch, not at gateways or trace-ingest paths."],"tags":["elasticsearch","opensearch","zipkin","version-detection","configuration","network"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}