# User script Error

**URL:** <https://discuss.elastic.co/t/user-script-error/132937>\
**Category:** Elasticsearch\
**Created:** [May 23, 2018, 7:27am UTC](https://discuss.elastic.co/t/user-script-error/132937 "2018-05-23T07:27:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MySunShine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mysunshine/32/31510_2.png) [@MySunShine](https://discuss.elastic.co/u/MySunShine)\
**Post date:** [May 23, 2018, 7:27am UTC](https://discuss.elastic.co/t/user-script-error/132937/1 "2018-05-23T07:27:32Z")

</div>

This is My first Error because I learn ES my English is not goods so please help me:  
i want user script  
and i send a post  
POST /test\_index/test\_type/4/\_update  
{  
"script": {  
"lang": "groovy",  
"file": "test-add-tags",  
"params": {  
"new\_tag": "tag1"  
}  
}  
}

but the result is error :  
{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "[script] unknown field [file], parser not found"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "[script] unknown field [file], parser not found"  
},  
"status": 400  
}  
and this is my script sources  
 ![1527060277(1)](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e2c80f1f87f69ee501ba5f31cfaaf82c71b3ba6a.png)  
 ![1527060336(1)](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e96852423c74d44849e207a8ab79a155ebd6432d.png)  
and in test-add-tags.groovy :  
ctx.\_source.tags+=new\_tag

please help me think you  
!!!!!!  
and i user es in 6.2.4

---

<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:** [May 23, 2018, 4:39pm UTC](https://discuss.elastic.co/t/user-script-error/132937/2 "2018-05-23T16:39:39Z")

</div>

Both the groovy script engine and file scripts were removed in elasticsearch 6.0. You should look at [painless scripts](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-painless.html) and [stored scripts](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-using.html#modules-scripting-stored-scripts).

---

<div class="post-metadata">

**Author:** ![MySunShine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mysunshine/32/31510_2.png) [@MySunShine](https://discuss.elastic.co/u/MySunShine)\
**Post date:** [May 24, 2018, 3:04am UTC](https://discuss.elastic.co/t/user-script-error/132937/3 "2018-05-24T03:04:55Z")

</div>

thank you very munch;

---

<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:** [June 21, 2018, 3:05am UTC](https://discuss.elastic.co/t/user-script-error/132937/4 "2018-06-21T03:05:06Z")

</div>

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