openzipkin/zipkin · critical · IllegalArgumentException

No content reading Elasticsearch/OpenSearch version

Error message

No content reading Elasticsearch/OpenSearch version

What it means

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.

Source

Thrown at zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/BaseVersion.java:59

    return Parser.INSTANCE.get(http);
  }

  /**
   * Does this version of Elasticsearch / OpenSearch still support mapping types?
   * @return "true" if mapping types are supported, "false" otherwise
   */
  public abstract boolean supportsTypes();
  
  enum Parser implements HttpCall.BodyConverter<BaseVersion> {
    INSTANCE;

    final Pattern REGEX = Pattern.compile("(\\d+)\\.(\\d+).*");

    BaseVersion get(HttpCall.Factory callFactory) throws IOException {
      AggregatedHttpRequest getNode = AggregatedHttpRequest.of(HttpMethod.GET, "/");
      BaseVersion version = callFactory.newCall(getNode, this, "get-node").execute();
      if (version == null) {
        throw new IllegalArgumentException("No content reading Elasticsearch/OpenSearch version");
      }
      return version;
    }

    @Override
    public BaseVersion convert(JsonParser parser, Supplier<String> contentString) {
      String version = null;
      String distribution = null;
      try {
        if (enterPath(parser, "version") != null) {
          while (parser.nextToken() != null) {
            if (parser.currentToken() == JsonToken.VALUE_STRING) {
              switch (parser.currentName()) {
                case "distribution":
                  distribution = parser.getText();
                  break;
                case "number":
                  version = parser.getText();

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Verify ES_HTTP_URL points at a real Elasticsearch/OpenSearch HTTP endpoint (curl $ES_HTTP_URL/ should return JSON with version.number).
  2. Fix proxy/LB routing or auth so the root endpoint returns the node info JSON.
  3. Remove trailing paths so the client hits '/' of the correct host.

Example fix

# before
ES_HTTP_URL=https://gateway.internal/api/traces

# after
ES_HTTP_URL=https://es.internal:9200
Defensive patterns

Strategy: validation

Validate before calling

// Probe the endpoint before building the ES storage
HttpResponse resp = http.get(esUrl + "/");
if (!resp.isJson() || resp.bodyJson().get("version") == null) throw new IllegalStateException(esUrl + " is not an Elasticsearch/OpenSearch endpoint");

Try / catch

catch (IllegalArgumentException e) { if (e.getMessage().contains("No content reading")) failStartupWithEsUrlHint(); else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: ES_HTTP_URL misconfigured to a gateway/ingress; auth plugin returning an empty body; ES behind a load balancer whose health page answers instead.

Related errors


AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14). Data as JSON: /api/errors/c53fdbd80223f668. Report an issue: GitHub.