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
Scripting: Wrap groovy script exceptions in a serializable Exception object #6598
Comments
Ping @dakrone. I'll work on it in a bit but I think it has to do with when a variable isn't found. |
@nik9000 sounds good, I definitely want to figure out what's causing this. |
@dakrone, got it: start a bunch of servers. Enough that your request goes to more then one. Then do this: curl -XPOST "http://localhost:9200/test/test/1?pretty" -d '{"content": "findme"}'
curl -XPOST "http://localhost:9200/test/test/2?pretty" -d '{"title": "cat", "content": "findme"}'
curl -XPOST "http://localhost:9200/test/test/3?pretty" -d '{"title": "table", "content": "findme"}'
curl -XPOST "http://localhost:9200/test/_refresh?pretty"
curl -XPOST "http://localhost:9200/test/test/_search?pretty" -d '{
"query": {
"filtered": {
"filter": {
"script": {
"script": "1 == not_found",
"lang": "groovy"
}
}
}
}
}' I don't imagine the contents of the documents matter - just that they end up on a bunch of nodes. {
"took" : 35,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 2,
"failed" : 3,
"failures" : [ {
"index" : "test",
"shard" : 4,
"status" : 500,
"reason" : "QueryPhaseExecutionException[[test][4]: query[filtered(ConstantScore(ScriptFilter(1 == not_found)))->cache(_type:test)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: MissingPropertyException[No such property: not_found for class: Script5]; "
}, {
"index" : "test",
"shard" : 3,
"status" : 500,
"reason" : "RemoteTransportException[Failed to deserialize exception response from stream]; nested: TransportSerializationException[Failed to deserialize exception response from stream]; nested: InvalidClassException[failed to read class descriptor]; nested: ClassNotFoundException[Script3]; "
}, {
"index" : "test",
"shard" : 2,
"status" : 500,
"reason" : "RemoteTransportException[Failed to deserialize exception response from stream]; nested: TransportSerializationException[Failed to deserialize exception response from stream]; nested: InvalidClassException[failed to read class descriptor]; nested: ClassNotFoundException[Script2]; "
} ]
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
} |
3 servers did it for me. |
I think it comes from trying to serialize the groovy exceptions objects, I would suggest we catch a script execution exception, but not have the throwable in our wrapping script exception. Users might run client side node/transport clients that don't have groovy in the class path for example. |
I think @kimchy's right. What I'm seeing is that groovy decided to name the compiled classes something different but even without that the chance that the user doesn't even have groovy in their classpath means we should transform the exception without adding the cause. I imagine MVEL didn't have this problem because MVEL was required and was interpreted instead of compiled to byte code. |
Thanks for bringing this up @nik9000! |
I'm playing around with groovy and I think exceptions aren't serializing properly:
I'm in the middle of work on #6566 so I don't have easy reproduction steps, but I'll see if I can make some soon.
The text was updated successfully, but these errors were encountered: