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

ES URL with Trailing Slash Causes Exception #5503

Closed
andrewkroh opened this issue Nov 2, 2017 · 0 comments
Closed

ES URL with Trailing Slash Causes Exception #5503

andrewkroh opened this issue Nov 2, 2017 · 0 comments
Labels

Comments

@andrewkroh
Copy link
Member

Adding an slash to the end of the configured ES URL causes an exception in ES when the template is installed at startup. It looks like the Beat uses a URL with a double slash in it like http://localhost:9200//_template/auditbeat-6.0.0-rc. This double slash can be avoided during the construction of the URL within Beats.

For confirmed bugs, please report:

  • Version: 6.0.0-rc2 tested with ES 5.4.1
  • Steps to Reproduce: Append a slash to the ES URL.
output.elasticsearch:
  hosts: ["10.100.6.80:9200/"]

sudo ./beat setup --template -e -d "*" --strict.perms=false

From Beats:

2017/11/02 16:46:45.394290 beat.go:625: CRIT Exiting: Error loading Elasticsearch template: could not load template: couldn't load template: couldn't load json. Error: 500 Internal Server Error. Response body: {"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}
Exiting: Error loading Elasticsearch template: could not load template: couldn't load template: couldn't load json. Error: 500 Internal Server Error. Response body: {"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}

From ES:

[2017-11-02T12:46:45,380][WARN ][r.suppressed             ] path: //_template/auditbeat-6.0.0-rc2, params: {index=, id=auditbeat-6.0.0-rc2, type=_template}
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:658) ~[?:1.8.0_111]
	at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexOrAliasName(MetaDataCreateIndexService.java:167) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:142) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validate(MetaDataCreateIndexService.java:495) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.access$000(MetaDataCreateIndexService.java:106) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:239) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:633) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:611) ~[elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:570) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:262) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247) [elasticsearch-5.4.1.jar:5.4.1]
	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210) [elasticsearch-5.4.1.jar:5.4.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant