# Cannot insert data at random times. \[OptionalDataException\]

**URL:** <https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476>\
**Category:** Elasticsearch\
**Created:** [November 16, 2020, 8:24am UTC](https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476 "2020-11-16T08:24:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nopma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nopma/32/46878_2.png) [@nopma](https://discuss.elastic.co/u/nopma)\
**Post date:** [November 16, 2020, 8:24am UTC](https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476/1 "2020-11-16T08:24:46Z")

</div>

I have 3 data nodes. I use fluentbit to send logs to elastic to only one node.  
Random times I see that it's failed to send data to elastic. It takes 1h exactly to resolve the issue.  
Its happen one per day. Some logs for random host they cannot insert anything for 1h some others they insert like 1/25 for the normal rate.

I cannot understand what happening.

**elastic** : elasticsearch-oss 7.9.1  
**Java** : openjdk 14.0.1 2020-04-14  
**jvm options** :  
-Xms10g  
-Xmx10g  
14-:-XX:+UseG1GC  
14-:-XX:G1ReservePercent=25  
14-:-XX:InitiatingHeapOccupancyPercent=30  
**Specs** :  
CPU: 12  
RAM: 16G

I see only the error message but i don't know if is relative:

```auto
{
  "_index": "index_name_2020.11.16",
  "_type": "_doc",
  "_id": "0c561660-8ef6-5375-00f7-41c7736f919a",
  "status": 500,
  "error": {
    "type": "exception",
    "reason": "java.io.OptionalDataException",
    "caused_by": {
      "type": "i_o_exception",
      "reason": null
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 11:12pm UTC](https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476/2 "2020-11-17T23:12:36Z")

</div>

What do the Elasticsearch logs show at that time?

---

<div class="post-metadata">

**Author:** ![nopma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nopma/32/46878_2.png) [@nopma](https://discuss.elastic.co/u/nopma)\
**Post date:** [November 18, 2020, 8:27am UTC](https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476/3 "2020-11-18T08:27:47Z")

</div>

nothing 😕 just the normal message

---

<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:** [December 16, 2020, 8:27am UTC](https://discuss.elastic.co/t/cannot-insert-data-at-random-times-optionaldataexception/255476/4 "2020-12-16T08:27:50Z")

</div>

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