Getting the error - Request cannot be executed; I/O reactor status: STOPPED

We are getting the below error when we are trying to do a getById call using high level rest client. We are using elasticsearch version 7.5.0.

java.lang.RuntimeException: Request cannot be executed; I/O reactor status: STOPPED
    at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:831)
    at org.elasticsearch.client.RestClient.performRequest(RestClient.java:248)
    at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
    at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1514)
    at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1484)
    at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1454)
    at org.elasticsearch.client.RestHighLevelClient.get(RestHighLevelClient.java:742)

Caused by: java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED
        at org.apache.http.util.Asserts.check(Asserts.java:46)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)
        at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:244)
        ... 91 common frames omitted

Note: It doesn't happen for every call, but when it happens it happens in a bust.

bump

Can you explain your usage of the rest client in a bit more detail? Are you using the async methods? Can you check your listeners to make sure you are not throwing any exceptions in the onFailure() method?

Also there is an ongoing open issue, where you can maybe provide some more insight at https://github.com/elastic/elasticsearch/issues/42133

No we are using the sync method only.

    //For write
    IndexRequest indexRequest = new IndexRequest("visibility");
    indexRequest.id(visibilityDocument.getRequestId());
    indexRequest.source(this.objectMapper.writeValueAsString(visibilityDocument), XContentType.JSON);
    log.debug("Creating Visibility Entry for RequestID {}", visibilityDocument.getRequestId());
    this.client.index(indexRequest, RequestOptions.DEFAULT);

    //For Read 
    GetRequest getRequest = new GetRequest("visibility", requestId);
    GetResponse getResponse = this.client.get(getRequest, RequestOptions.DEFAULT);
    return (VisibilityDocument)this.objectMapper.readValue(getResponse.getSourceAsBytes(), VisibilityDocument.class);

and just to be sure, you are not closing that client at any point in time?

If not, feel free to add some more information to the above issue to help developers to pinpoint the problem further.

1 Like

No we are not closing the client anywhere. We initiate the client during application startup and close it only when the app is getting shut down. What other details are required?

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