Kibana: Unable to specify array in `ELASTICSEARCH_HOSTS` when trying to run Kibana docker image

Created on 25 Jul 2019  路  5Comments  路  Source: elastic/kibana

Kibana version: 7.2.0

Elasticsearch version: 7.2.0

Server OS version: MacOS

Browser version: N/A

Browser OS version: N/A

Original install method (e.g. download page, yum, from source, etc.): Docker

Describe the bug:
When trying to pass an array in the ELASTICSEARCH_HOSTS env variable I'm getting a validation error.

Steps to reproduce:
I've tried various combinations of quotes, [ operator, spaces etc.

docker run --name kibana5 -p 5605:5601 -e ELASTICSEARCH_HOSTS='["http://10.45.3.2:9220,http://10.45.3.1:9230"]' -e "SERVER_NAME=localhost" docker.elastic.co/kibana/kibana:7.1.1

Expected behavior:
Container starts with an array of ELASTICSEARCH_HOSTS

Actual behavior:
Server crashes with log message given below.

Provide logs and/or server output (if relevant):

^C{"type":"log","@timestamp":"2019-07-25T20:23:11Z","tags":["fatal","root"],"pid":1,"message":"{ ValidationError: child \"elasticsearch\" fails because [child \"hosts\" fails because [\"hosts\" at position 0
fails because [\"0\" must be a valid uri with a scheme matching the http|https pattern]]]\n    at Object.exports.process (/usr/share/kibana/node_modules/joi/lib/errors.js:196:19)\n    at internals.Object._val
idateWithOptions (/usr/share/kibana/node_modules/joi/lib/types/any/index.js:675:31)\n    at module.exports.internals.Any.root.validate (/usr/share/kibana/node_modules/joi/lib/index.js:146:23)\n    at Config._
commit (/usr/share/kibana/src/legacy/server/config/config.js:143:35)\n    at Config.set (/usr/share/kibana/src/legacy/server/config/config.js:111:10)\n    at Config.extendSchema (/usr/share/kibana/src/legacy/
server/config/config.js:84:10)\n    at extendConfigService (/usr/share/kibana/src/legacy/plugin_discovery/plugin_config/extend_config_service.js:45:10) name: 'ValidationError' }"}

 FATAL  ValidationError: child "elasticsearch" fails because [child "hosts" fails because ["hosts" at position 0 fails because ["0" must be a valid uri with a scheme matching the http|https pattern]]]

Any additional context:

Configuration Operations bug

Most helpful comment

Maybe this:

ELASTICSEARCH_HOSTS='["http://10.45.3.2:9220","http://10.45.3.1:9230"]'

I just put each host URI in its own quotes.

All 5 comments

Pinging @elastic/kibana-platform

Pinging @elastic/kibana-operations

Maybe this:

ELASTICSEARCH_HOSTS='["http://10.45.3.2:9220","http://10.45.3.1:9230"]'

I just put each host URI in its own quotes.

That works! Thanks @cullylarson

mine does not work
docker run --name kibana -e ELASTICSEARCH_HOSTS='["https://es1:9201","https://es2:9202"]' -e SERVER_PORT=5601 -e SERVER_HOST=0.0.0.0 -p 5601:5601 --network=network -d kibana:6.7.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlexIoannides picture AlexIoannides  路  138Comments

rashidkpc picture rashidkpc  路  116Comments

Vineeth-Mohan picture Vineeth-Mohan  路  149Comments

seti123 picture seti123  路  100Comments

ctindel picture ctindel  路  81Comments