# Elasticsearch Nodes Crash After Attempt to Create Scripted Filed

**URL:** <https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179>\
**Category:** Elasticsearch\
**Created:** [February 3, 2021, 11:29pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179 "2021-02-03T23:29:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [February 3, 2021, 11:29pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179/1 "2021-02-03T23:29:58Z")

</div>

Hello Community,  
I am trying to create a scripted field.  
I want to parse a string into a date format.  
I have created the following script

```auto
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime localDateTime = LocalDateTime.parse(doc['closed_at.keyword'].value, formatter);
return localDateTime;

```

The above works well in the Painless Lab.

 ![2021-02-04 10_17_47-Dev Tools - Elastic](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c72fcaa486624ab694dddcf06b740c3244588370.png)

When I am trying to run it in the scripted field module (Under index patterns), I am getting an error

```auto
{
 "root_cause": [
  {
   "type": "node_disconnected_exception",
   "reason": "[Node4][IP:9300][indices:data/read/search[phase/query]] disconnected"
  }
 ],
 "type": "search_phase_execution_exception",
 "reason": "all shards failed",
 "phase": "query",
 "grouped": true,
 "failed_shards": [
  {
   "shard": 0,
   "index": "my-index",
   "node": "wKXfVA24TgugQ_bCVs8wVR",
   "reason": {
    "type": "node_disconnected_exception",
    "reason": "[Node4][IP:9300][indices:data/read/search[phase/query]] disconnected"
   }
  }
 ]
}

```

`GET /_cluster/health` after first run

```auto
{
"cluster_name" : "name",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 5,
"number_of_data_nodes" : 5,
"active_primary_shards" : 802,
"active_shards" : 1604,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}

```

When pressing the 'Run Script' in a consecutive second time, 2 nodes out of 5 crash and cluster turns tither to yellow or red.

Cheers!

---

<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:** [February 4, 2021, 4:18am UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179/2 "2021-02-04T04:18:12Z")

</div>

What do the Elasticsearch logs show?

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [February 4, 2021, 10:25pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179/3 "2021-02-04T22:25:13Z")

</div>

Haven't seen anything critical there.  
I am monitoring it still.  
Cheers!

---

<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:** [February 6, 2021, 11:33pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179/4 "2021-02-06T23:33:05Z")

</div>

If Elasticsearch is crashing then the logs will contain something useful.

---

<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:** [March 6, 2021, 11:33pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-crash-after-attempt-to-create-scripted-filed/263179/5 "2021-03-06T23:33:40Z")

</div>

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