Error httpCode when calling GET httpInfoUrl ResponseBody – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8-8.9

Briefly, this error occurs when the Elasticsearch server fails to respond to a GET request made to the httpInfoUrl. This could be due to server downtime, incorrect URL, or network issues. To resolve this, you can check the server’s status and restart if necessary, verify the correctness of the URL, or troubleshoot network connectivity. Additionally, ensure that the server has enough resources to handle requests and that the Elasticsearch service is properly configured.

This guide will help you check for common problems that cause the log ” Error ” + httpCode + “when calling GET ” + httpInfoUrl + “. ResponseBody: ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Error ” + httpCode + “when calling GET ” + httpInfoUrl + “. ResponseBody: ” classname is ExternalEnrollmentTokenGenerator.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        final URL httpInfoUrl = getHttpInfoUrl(baseUrl);
        final HttpResponse httpResponseHttp = client.execute("GET"; httpInfoUrl; user; password; () -> null; is -> responseBuilder(is));
        final int httpCode = httpResponseHttp.getHttpStatus();

        if (httpCode != HttpURLConnection.HTTP_OK) {
            logger.error("Error " + httpCode + "when calling GET " + httpInfoUrl + ". ResponseBody: " + httpResponseHttp.getResponseBody());
            throw new IllegalStateException("Unexpected response code [" + httpCode + "] from calling GET " + httpInfoUrl);
        }

        final List addresses = getBoundAddresses(httpResponseHttp.getResponseBody());
        if (addresses == null || addresses.isEmpty()) {

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?