Unable to find scripts files on disk exception


#1

The following is the exception I get

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


(David Pilato) #2

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.


#3

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]"


#4

Please help me out with this


(David Pilato) #5

Read this and specifically the "Also be patient" part.


(David Pilato) #6

You need to use a painless script instead.


#7

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
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"
}
}
}
}


(David Pilato) #8

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 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.


#9

ok sir thank u..


(system) closed #10

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