# Unable to create an update script

**URL:** https://discuss.elastic.co/t/unable-to-create-an-update-script/158146
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [November 26, 2018, 9:36am UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146 "2018-11-26T09:36:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![markmevans](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@markmevans](https://discuss.elastic.co/u/markmevans)
#### Post date: [November 26, 2018, 9:36am UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146/1 "2018-11-26T09:36:46Z")

</div>

We are running 2 instances of ElasticCloud version 5.6 - One for production and another for dev/test.  
I have run the following simple script successfully in in Kibana for the non-production instance

POST \_scripts/update\_name  
{  
"script" : {  
"lang" : "painless",  
"source" : "ctx.\_source.NAME=params.p\_NAME;"  
}  
}

However, when I run this same script on the production instance I get the following error

{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "failed to parse/compile stored script [update\_name]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "failed to parse/compile stored script [update\_name]",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "cannot put stored script [update\_name], stored scripts cannot be run under any context"  
}  
},  
"status": 400  
}

Not sure if it is related but I have read about security settings in the following document ([https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting-security.html#enable-dynamic-scripting](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting-security.html#enable-dynamic-scripting))  
However, I can't see how these values are accessible on ElasticCloud if this is the issue.

---

<div class="post-metadata">

### Author: ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)
#### Post date: [November 26, 2018, 7:59pm UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146/2 "2018-11-26T19:59:23Z")

</div>

Which version of Elasticsearch are you using?

---

<div class="post-metadata">

### Author: ![markmevans](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@markmevans](https://discuss.elastic.co/u/markmevans)
#### Post date: [November 27, 2018, 10:13am UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146/3 "2018-11-27T10:13:41Z")

</div>

Hi Ryan,  
Many thanks for reading my query.

Running GET / on kibana on PROD which will not allow me to create the script to run I get

```
"number": "5.6.9",
"lucene_version": "6.6.1"

```

I notice that NON-PROD where I could create the script successfully is at version "5.6.10".

Regards,  
Mark

---

<div class="post-metadata">

### Author: ![markmevans](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@markmevans](https://discuss.elastic.co/u/markmevans)
#### Post date: [November 27, 2018, 4:26pm UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146/4 "2018-11-27T16:26:38Z")

</div>

Our ElasticSearch administrator was able to find the settings and there was a radio button to enable the running of scripts. This was set and 27 minutes later I was able to run the script.

---

<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 25, 2018, 4:26pm UTC](https://discuss.elastic.co/t/unable-to-create-an-update-script/158146/5 "2018-12-25T16:26:47Z")

</div>

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