# Unable to find scripts files on disk exception

**URL:** https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023
**Category:** Elasticsearch
**Created:** [March 21, 2018, 3:46pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023 "2018-03-21T15:46:18Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![saii](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@saii](https://discuss.elastic.co/u/saii)
#### Post date: [March 21, 2018, 3:46pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/1 "2018-03-21T15:46:18Z")

</div>

The following is the exception I get

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/8/68cf9fa1c66946c7d08a0a27d9b015b63ecf0075.png)

How can I overcome this?  
I have understood that the script file hourly which I used in a watcher program is not being loaded..But .scripts is one of the indices present in elasticsearch..How to overcome this error..Please help me out

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 21, 2018, 4:00pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/2 "2018-03-21T16:00:46Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

Are you using an old version BTW? Asking that because Groovy is not supported anymore.

---

<div class="post-metadata">

### Author: ![saii](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@saii](https://discuss.elastic.co/u/saii)
#### Post date: [March 21, 2018, 4:50pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/3 "2018-03-21T16:50:06Z")

</div>

Yes.. I was actually practicing a watcher program with an older version of Elasticsearch..So for an older version if the exception arises what can be done?

"type" : "script\_exception",  
"reason":"failed tp compile script [java.lang.IllegalArgumentException: Unable to find on disk file script [hourly] using lang [groovy]] with lang [hourly] of type [groovy]"

---

<div class="post-metadata">

### Author: ![saii](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@saii](https://discuss.elastic.co/u/saii)
#### Post date: [March 21, 2018, 5:03pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/4 "2018-03-21T17:03:14Z")

</div>

Please help me out with this

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 21, 2018, 5:54pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/5 "2018-03-21T17:54:29Z")

</div>

Read [this](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and specifically the "Also be patient" part.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 21, 2018, 5:55pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/6 "2018-03-21T17:55:02Z")

</div>

You need to use a painless script instead.

---

<div class="post-metadata">

### Author: ![saii](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@saii](https://discuss.elastic.co/u/saii)
#### Post date: [March 21, 2018, 6:11pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/7 "2018-03-21T18:11:11Z")

</div>

The following is the complete script

I have taken this just for a practice purpose..  
The link is [https://www.elastic.co/blog/implementing-a-statistical-anomaly-deetector-part-3](https://www.elastic.co/blog/implementing-a-statistical-anomaly-deetector-part-3)  
Can u help me out with this..For compatibility I have used watcher 2.4 for Elasticsearch 2.4.3 version..Please help

PUT \_watcher/watch/atlas  
{  
"trigger":{  
"schedule":{  
"hourly" : { "minute" : 0 }  
}  
},  
"input":{  
"search":{  
"request":{  
"indices":"data",  
"types": "data",  
"body":{  
"query":{  
"filtered":{  
"filter":{  
"range":{  
"hour":{  
"gte":"now-24h"  
}  
}  
}  
}  
},  
"size":0,  
"aggs":{  
"metrics":{  
"terms":{  
"field":"metric"  
},  
"aggs":{  
"queries":{  
"terms":{  
"field":"query"  
},  
"aggs":{  
"series":{  
"date\_histogram":{  
"field":"hour",  
"interval":"hour"  
},  
"aggs":{  
"avg":{  
"avg":{  
"field":"value"  
}  
},  
"movavg":{  
"moving\_avg":{  
"buckets\_path":"avg",  
"window":24,  
"model":"simple"  
}  
},  
"surprise":{  
"bucket\_script":{  
"buckets\_path":{  
"avg":"avg",  
"movavg":"movavg"  
},  
"script":"(avg - movavg).abs()"  
}  
}  
}  
},  
"largest\_surprise":{  
"max\_bucket":{  
"buckets\_path":"series.surprise"  
}  
}  
}  
},  
"ninetieth\_surprise":{  
"percentiles\_bucket":{  
"buckets\_path":"queries\>largest\_surprise",  
"percents":[  
90.0  
]  
}  
}  
}  
}  
}  
}  
},  
"extract":[  
"aggregations.metrics.buckets.ninetieth\_surprise",  
"aggregations.metrics.buckets.key"  
]  
}  
},  
"actions":{  
"index\_payload":{  
"transform":{  
"script": {  
"file": "hourly"  
}  
},  
"index" : {  
"index" : "atlas",  
"doc\_type" : "data"  
}  
}  
}  
}

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 21, 2018, 7:13pm UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/8 "2018-03-21T19:13:32Z")

</div>

No I can't. I don't know Watcher a lot. So I'm moving your question to #x-pack where it fits better I think.

Anyway, please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

---

<div class="post-metadata">

### Author: ![saii](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@saii](https://discuss.elastic.co/u/saii)
#### Post date: [March 22, 2018, 3:35am UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/9 "2018-03-22T03:35:50Z")

</div>

ok sir thank u..

---

<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: [April 19, 2018, 3:35am UTC](https://discuss.elastic.co/t/unable-to-find-scripts-files-on-disk-exception/125023/10 "2018-04-19T03:35:53Z")

</div>

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