Getting 500 error in es5.0.0

(David Earl) #1


I'm experimenting with moving my app to ES5 (though probably won't do so for real until it is a bit more mature).

The first scroll query it does with more than "size" results gives an error, which I can't account for in my code. The initial request for a scrolled search yields the 250 results I asked for, but the second gets a 500 error.

The initial request is a POST (and "current" is, of course, the type)

The second batch of results is (abbreviated a little):
.../_search/scroll/: {"scroll":"60s","scroll_id":"DX...Q=="}

and it returns:
"error" : {
"root_cause" : [
"type" : "string_index_out_of_bounds_exception",
"reason" : "String index out of range: 0"
"type" : "string_index_out_of_bounds_exception",
"reason" : "String index out of range: 0"
"status" : 500

This code works in es2.4, though I have been through and changed all my mappings to account for the string type changes (and reloaded all the data - why the gratuitous change not to allow POST for index creation when you can use POST everywhere else!? That broke my restore scripts.) and also reworked all my and/or queries to bool (changes which seem ok in 2.4)

The other issue might be that I cam using OpenJDK (which I updated to the most recent version available, OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)). I do not (think I) have the option to use Sun Java as this is an ARM processor. But you do say "Elasticsearch will refuse to start if a known-bad version of Java is used."

The log file shows:
[2016-11-06T18:29:08,029][WARN ][r.suppressed ] path: //_search/scroll/, params: {pretty=, index=, id=scroll, type=_search}
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt( ~[?:1.8.0_111]
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName( ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate( ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$000( ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute( ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.ClusterStateUpdateTask.execute( ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.service.ClusterService.runTasksForExecutor( [elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cluster.service.ClusterService$ [elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ [elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean( [elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$ [elasticsearch-5.0.0.jar:5.0.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_111]
at [?:1.8.0_111]

Elasticsearch 5 conversion
(Alexander Reelsen) #2


openjdk is just fine, dont worry about it.

I see this in one error message

[2016-11-06T18:29:08,029][WARN ][r.suppressed ] path: //_search/scroll/, params: {pretty=, index=, id=scroll, type=_search}

There are to slashes at the beginning of the URL being //_search.

Can you make sure you remove that double slash and if the error persists, can you file a github issue, please?

Thanks so much!


(David Earl) #3

Thanks, you're right, it was that.

This was, of course, because I am using the same code to do all the curl requests, and this is a rare case (indeed, I think apart from index creation, the only one I use) where index is not given so was substituting an empty string when building the URL. This didn't seem to bother earlier versions.

(Still, it would be better if it didn't do a 500 error, but I can see why it might get upset).

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.