Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScriptParameterParseException when upgrading from 1.4 -> 1.5.2 #10926

Closed
aewhite opened this issue May 1, 2015 · 4 comments · Fixed by #10976
Closed

ScriptParameterParseException when upgrading from 1.4 -> 1.5.2 #10926

aewhite opened this issue May 1, 2015 · 4 comments · Fixed by #10976
Assignees
Labels
>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache

Comments

@aewhite
Copy link

aewhite commented May 1, 2015

After upgrading from 1.4 -> 1.5.2 shards fail to load due to ScriptParameterParseException.

Stacktrace:

org.elasticsearch.script.ScriptParameterParser$ScriptParameterParseException: Value must be of type String: [lang]
        at org.elasticsearch.script.ScriptParameterParser.parseConfig(ScriptParameterParser.java:111)
        at org.elasticsearch.index.mapper.DocumentMapperParser.parseTransform(DocumentMapperParser.java:307)
        at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:257)
        at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:192)
        at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:434)
        at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:307)
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.processMapping(IndicesClusterStateService.java:430)
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.applyMappings(IndicesClusterStateService.java:376)
        at org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:181)
        at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:467)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:188)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:158)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

The cause as I can best understand is the lang property is getting set to null for some transform scripts. We do not explicitly set the lang so this was unexpected. Our process is to use a template...

"mappings": {
            "<type>": {                
                "transform": [
                    {"script": "<source>"},
...

However, the mapping produced after an index creation (in 1.4) is...

{
    "<index-name>": {
        "mappings": {
            "<type>": {
                "transform": [
                    {"script": "<source>","lang": null}
...

The above mapping works in 1.4 but not in 1.5 it seems.

@clintongormley clintongormley added >bug :Search/Mapping Index mappings, including merging and defining field types labels May 4, 2015
@clintongormley
Copy link

@colings86 please could you take a look. probably related to #7977

@aewhite
Copy link
Author

aewhite commented May 4, 2015

Note to others; the only workaround I have found that works is to recreate the index and set lang property on transform explicitly. Perhaps there is a way to update an existing transform but it is not mentioned in the Transform Documentation at this time.

@colings86 colings86 added :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache and removed :Search/Mapping Index mappings, including merging and defining field types labels May 5, 2015
@colings86
Copy link
Contributor

@aewhite thanks for raising this. When the transform is written in the mapping the script language is written even if it is set to null (null meaning use the default). I have opened PR #10976 which lets the parser reading the stored mapping read null for the script language instead of throwing an error

@colings86
Copy link
Contributor

@aewhite thanks again for raising this. The fix has now been merged in and should be available from 1.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants