# Elasticsearch unable to find my script

**URL:** <https://discuss.elastic.co/t/elasticsearch-unable-to-find-my-script/70990>\
**Category:** Elasticsearch\
**Created:** [January 9, 2017, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-find-my-script/70990 "2017-01-09T20:01:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geantbrun](https://avatars.discourse-cdn.com/v4/letter/g/ecb155/32.png) [@geantbrun](https://discuss.elastic.co/u/geantbrun)\
**Post date:** [January 9, 2017, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-find-my-script/70990/1 "2017-01-09T20:01:30Z")

</div>

Hi,  
I'm using ES 2.4.3 and it seems that ES cannot find my scripts folder. We are running our cluster on 3 nodes : one master (directory /etc/elasticsearch) and 2 data nodes, each of them is running the service 2 times (directories /etc/elasticsearch\_a and b). I tried to put the scripts directory under /etc/elasticsearch for master and under /etc/elasticsearch\_a and b for data nodes but it doesn't work. Tried also /etc/elasticsearch/config (and /etc/elasticsearch\_a/config and \_b/config) but it does not work either.

Query is:  
{  
"query": {  
"function\_score": {  
"query": {  
"filtered": {  
"filter": {  
"bool": {  
"should": [],  
"must": [  
{  
"range": {  
"date": {  
"to": "20161231",  
"from": "20090107"  
}  
}  
}  
]  
}  
},  
"query": {  
"term": {  
"ktextp": "bourse"  
}  
}  
}  
},  
"functions": [  
{  
"script\_score": {  
"script": {  
"lang": "groovy",  
"file": "calculate-score",  
"params": {  
"user\_origin": "//europe//france",  
"now": "2016-01-15T10:08:37",  
"user\_language": "Français"  
}  
}  
}  
}  
]  
}  
},  
"size": "100"  
}

Output message is:  
{  
"error": {  
"root\_cause": [  
{  
"type": "query\_parsing\_exception",  
"reason": "script\_score the script could not be loaded",  
"index": "test",  
"line": 46,  
"col": 11  
}  
],  
"type": "search\_phase\_execution\_exception",  
"reason": "all shards failed",  
"phase": "query\_fetch",  
"grouped": true,  
"failed\_shards": [  
{  
"shard": 0,  
"index": "test",  
"node": "eBRltcS0T\_qUPKJmrqn00A",  
"reason": {  
"type": "query\_parsing\_exception",  
"reason": "script\_score the script could not be loaded",  
"index": "test",  
"line": 46,  
"col": 11,  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "Unable to find on disk file script [calculate-score] using lang [groovy]"  
}  
}  
}  
]  
},  
"status": 400  
}

Any help greatly appreciated!

---

<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:** [January 12, 2017, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-find-my-script/70990/2 "2017-01-12T05:57:39Z")

</div>

From [Scripting | Elasticsearch Guide [2.4] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-scripting.html)

> You will still be able to use Groovy scripts stored in files in the `config/scripts/` directory on every node.

---

<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:** [February 9, 2017, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-unable-to-find-my-script/70990/3 "2017-02-09T05:57:46Z")

</div>

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