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(
    at org.elasticsearch.client.RestClient.performRequest(
    at org.elasticsearch.client.RestClient.performRequest(
    at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(
    at org.elasticsearch.client.RestHighLevelClient.performRequest(
    at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(
    at org.elasticsearch.client.RestHighLevelClient.get(

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

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


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

No we are using the sync method only.

    //For write
    IndexRequest indexRequest = new IndexRequest("visibility");;
    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.