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

UpdateByQueryRequest fails with slices set to 0 #54098

Closed
alainbodiguel opened this issue Mar 24, 2020 · 3 comments
Closed

UpdateByQueryRequest fails with slices set to 0 #54098

alainbodiguel opened this issue Mar 24, 2020 · 3 comments
Assignees

Comments

@alainbodiguel
Copy link

Describe the feature:

Elasticsearch version (bin/elasticsearch --version): 7.6.0

Plugins installed: []

JVM version (java -version): 8

OS version (uname -a if on a Unix-like system):

Description of the problem including expected versus actual behavior:
With the JAVA High Level REST client, executing an UpdateByQueryRequest with a slice value of '0' results in an error: "[slices] must be a positive integer or the string "auto", but was [0]".

Obvioulsy as the setSlices() method expects an integer, we can't set the auto value.

Steps to reproduce:

        UpdateByQueryRequest request = new UpdateByQueryRequest("myindex")
                .setQuery(this.getBoolQueryBuilder())
                .setSlices(0)
                .setScript(myscript);
        BulkByScrollResponse response = esClient.updateByQuery(request, RequestOptions.DEFAULT);

Provide logs (if relevant):

Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://elasticsearch:9200], URI [/dataset/_update_by_query?slices=0&requests_per_second=-1&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&max_docs=2147483647&timeout=1m], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"[slices] must be a positive integer or the string \"auto\", but was [0]"}],"type":"illegal_argument_exception","reason":"[slices] must be a positive integer or the string \"auto\", but was [0]"},"status":400}
		at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:283)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:261)
		at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
		at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1514)
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client)

@cbuescher cbuescher self-assigned this Mar 25, 2020
@cbuescher
Copy link
Member

@alainbodiguel thanks for opening this issue, I think this is the same as #53044 which should be fixed by #53068 in 7.6.2 coming out as the next patch release. I'll close this issue for that reason. Please reopen if the same behaviour still happens on a 7.6.2 client/server combination.

@cbuescher
Copy link
Member

Closing as a duplicate of #53044

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants