# Elasticsearch update script is not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-update-script-is-not-working/142319>\
**Category:** Elasticsearch\
**Created:** [July 31, 2018, 9:05am UTC](https://discuss.elastic.co/t/elasticsearch-update-script-is-not-working/142319 "2018-07-31T09:05:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay\_kumar\_Ks](https://avatars.discourse-cdn.com/v4/letter/v/c77e96/32.png) [@vijay\_kumar\_Ks](https://discuss.elastic.co/u/vijay_kumar_Ks)\
**Post date:** [July 31, 2018, 9:05am UTC](https://discuss.elastic.co/t/elasticsearch-update-script-is-not-working/142319/1 "2018-07-31T09:05:56Z")

</div>

As mentioned in [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html)  
above link tried updating a document in elasticsearch  
Version: 5.1.2  
request tried:  
URL: [http://localhost:9200/idx001/sdoc/f07d3ad282fb5303156851317bc36c29/\_update](http://localhost:9200/idx001/sdoc/f07d3ad282fb5303156851317bc36c29/_update)  
request body: {  
"script" : "ctx.\_source.offices = vijay"  
}

Result: `{ "error": { "root_cause": [{ "type": "remote_transport_exception", "reason": "[ssssss-node-1][127.0.0.1:9300][indices:data/write/update[s]]" } ], "type": "illegal_argument_exception", "reason": "failed to execute script", "caused_by": { "type": "illegal_argument_exception", "reason": "script_lang not supported [painless]" } }, "status": 400 }`

please check

---

<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:** [August 2, 2018, 11:19am UTC](https://discuss.elastic.co/t/elasticsearch-update-script-is-not-working/142319/2 "2018-08-02T11:19:30Z")

</div>

can you share your configuration? and a full reproducible example instead of just snippets?

---

<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:** [August 30, 2018, 11:19am UTC](https://discuss.elastic.co/t/elasticsearch-update-script-is-not-working/142319/3 "2018-08-30T11:19:43Z")

</div>

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