ES version 6.3. IOException: listener timeout after waiting for [60000] ms

Hello,

I've just updated to elasticsearch version 6.3.0 and seems that rest high level client doesn't work there as has to.
Right now I am using the next code to refresh indexes:

Settings settings = Settings.builder()
        .put("client.transport.sniff", true)
        .put("cluster.name", "test-signle-cluster")
        .build();

System.setProperty("es.set.netty.runtime.available.processors", "false");

TransportClient client = new PreBuiltTransportClient(settings);
client.addTransportAddress(new TransportAddress(InetAddress.getByName("192.168.56.50"), 9300));

And then use the next method to refresh indices:
transportClient.admin().indices().prepareRefresh().get()

Now, I would like to update my client to use REST High Level Client. I've changed my code to:

System.setProperty("es.set.netty.runtime.available.processors", "false");

RestClientBuilder restClientBuilder = RestClient.builder(new HttpHost("192.168.56.50", 9200, "http"));
restClientBuilder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
    @Override
    public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) {
        return requestConfigBuilder.setConnectTimeout(60000).setSocketTimeout(60000)
                .setConnectionRequestTimeout(0);
    }
});
restClientBuilder.setMaxRetryTimeoutMillis(60000);
RestHighLevelClient client = new RestHighLevelClient(restClientBuilder);

And now I try to refresh indices with the next code:
client.indices().refresh(new RefreshRequest());

Unfortunately I am getting an error when I am trying to refresh indices:

java.io.IOException: listener timeout after waiting for [60000] ms
        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:684)
...

Here is the full log: http://paste.openstack.org/show/723460/

Here is my gradle dependencies:

compile "org.elasticsearch:elasticsearch:6.3.0"
compile "org.elasticsearch.client:elasticsearch-rest-high-level-client:6.3.0"
compile "org.elasticsearch.client:elasticsearch-rest-client:6.3.0"
compile "org.elasticsearch.client:transport:6.3.0"

Does anyone know why is it happening? My elasticsearch 6.3.0 is running under virtual machine. All ports are open. I can perform requests by using curl to port 9200 but REST High Level Client doesn't work.

Best regards

Can you share your elasticsearch logs please?

Also can you run this from the same machine the code is running:

curl 192.168.56.50:9200

Yes, sure.

Here is curl execution from the same machine the code is running:

$ curl 192.168.56.50:9200
{
  "name" : "test-data-1",
  "cluster_name" : "test-signle-cluster",
  "cluster_uuid" : "hz8o0onWThqy6xL7T7OhDQ",
  "version" : {
    "number" : "6.3.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "424e937",
    "build_date" : "2018-06-11T23:38:03.357887Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Here is my logs from /var/log/elasticsearch/test-signle-cluster.log: http://paste.openstack.org/show/723461/

Normally you need only to import:

compile "org.elasticsearch.client:elasticsearch-rest-high-level-client:6.3.0"

Anyway, that's really strange. I just started a 6.3.0 and I'm able to use the client without any problem.

Could you remove this part and test again?

restClientBuilder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
    @Override
    public RequestConfig.Builder customizeRequestConfig(RequestConfig.Builder requestConfigBuilder) {
        return requestConfigBuilder.setConnectTimeout(60000).setSocketTimeout(60000)
                .setConnectionRequestTimeout(0);
    }
});
restClientBuilder.setMaxRetryTimeoutMillis(60000);

So you will just have:

System.setProperty("es.set.netty.runtime.available.processors", "false");

RestClientBuilder restClientBuilder = RestClient.builder(new HttpHost("192.168.56.50", 9200, "http"));
RestHighLevelClient client = new RestHighLevelClient(restClientBuilder);

// ....

client.indices().refresh(new RefreshRequest());

Ow now. Sorry for wasting your time. Actually, everything works.
I was actually passing a parameter with the host name into new HttpHost(myHost, port, scheme) and the problem was that I by mistake passed there a wrong host parameter.
Sorry again for wasting your time!

No problem. Glad you figured it out.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.