I'm trying to deploy scripts into the config/scripts directory by setting a symlink to a newly deployed release. This effectively puts the scripts into a subdirectory of config/scripts, i.e. config/scripts/myapp/myscript
I notice from looking at elasticsearch .log that the script is found and compiled, but when I try to execute the script in an indexing/update operation I get "ElasticsearchIllegalArgumentException[Unable to find on disk script ..."
What's the issue? Are we not allowed to put scripts in subdirectories, or link them via symlink (even though it appears to find and compile them)? Do I have to add some sort of prefix to the script_file name?
I've have not tried loading file scripts from a symlinked directory before, but it looks like its accessible as you mentioned that your are seeing the compile script message in the logs. Could you paste the whole response here as well as the request?
Response:
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":"ElasticsearchIllegalArgumentException[failed to execute script]; nested: ElasticsearchIllegalArgumentException[Unable to find on disk script myscript_name]; ","status":400}
Have a look at the documentation here (at the end of the first section just before the "Indexed Scripts" section, but if your script is in scripts/myapp/myscript_name.groovy then you will need to reference your script as myapp_myscript_name.
The name of the script is derived from the hierarchy of directories it exists under,
and the file name without the lang extension. For example, a script placed under
config/scripts/group1/group2/test.py will be named group1_group2_test.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.