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
Update API: Setting ctx.op to random string results in noop #43514
Comments
Pinging @elastic/es-distributed |
can I take this up? @spinscale @dnhatn |
@abhiroj Yes |
cool! how should I get started to reproduce it @dnhatn can you point me to the Class |
@abhiroj I think resolving this takes following steps: 1.reproduce it using the example above against an elasticsearch node. |
It’s still present in the latest code base # Request
curl -XPOST 'http://localhost:9200/test/_update/1' -H 'Content-Type: application/json' -u elastic-admin:elastic-password -d '
{
"script": {
"source": "ctx._source.foo = '\''bar'\''; ctx.op = '\''anything'\''",
"lang": "painless"
}
}' # Response (“noop” for the result field)
{"_index":"test","_id":"1","_version":1,"result":"noop","_shards":{"total":0,"successful":0,"failed":0},"_seq_no":0,"_primary_term":1} @abhiroj , are you currently working on this? If not I can take this up. |
@spinscale I've create a WIP PR for this, please let me know if this aligns with what you are considering. |
@spinscale Any update on this? |
Elasticsearch version (
bin/elasticsearch --version
): 7.1.1Description of the problem including expected versus actual behavior:
When using a script in the Update API, setting
ctx.op
to any string will result in a noop. IMO this should throw an exception, if it's anything else than the suggested ones.This leniency is actually documented with a TODO, but I do not know the history behind that (that todo is from early 2017). Also a warn message is logged.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: