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

**URL:** <https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702>\
**Category:** Elasticsearch\
**Created:** [March 16, 2020, 7:17am UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702 "2020-03-16T07:17:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshaymaniyar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshaymaniyar/32/45836_2.png) [@akshaymaniyar](https://discuss.elastic.co/u/akshaymaniyar)\
**Post date:** [March 16, 2020, 7:17am UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/1 "2020-03-16T07:17:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![akshaymaniyar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshaymaniyar/32/45836_2.png) [@akshaymaniyar](https://discuss.elastic.co/u/akshaymaniyar)\
**Post date:** [March 19, 2020, 2:03pm UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/2 "2020-03-19T14:03:11Z")

</div>

_bump_

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 19, 2020, 2:43pm UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/3 "2020-03-19T14:43:23Z")

</div>

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](https://github.com/elastic/elasticsearch/issues/42133)

---

<div class="post-metadata">

**Author:** ![akshaymaniyar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshaymaniyar/32/45836_2.png) [@akshaymaniyar](https://discuss.elastic.co/u/akshaymaniyar)\
**Post date:** [March 22, 2020, 10:10am UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/4 "2020-03-22T10:10:20Z")

</div>

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);
```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 23, 2020, 10:39am UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/5 "2020-03-23T10:39:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![akshaymaniyar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshaymaniyar/32/45836_2.png) [@akshaymaniyar](https://discuss.elastic.co/u/akshaymaniyar)\
**Post date:** [March 26, 2020, 4:38pm UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/6 "2020-03-26T16:38:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 23, 2020, 4:38pm UTC](https://discuss.elastic.co/t/getting-the-error-request-cannot-be-executed-i-o-reactor-status-stopped/223702/7 "2020-04-23T16:38:46Z")

</div>

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