Issue setting Server BasePath via Env Variable

I'm trying to set the server basepath via a SERVER_BASEPATH environment variable on Kibana 5.2.1. The value does not appear to be picked up. I can set it via server.basePath in Kibana.yml fine. I can also change other environment variables such as ELASTICSEARCH_URL and Kibana reads these values fine.

I am following this guide:
https://www.elastic.co/guide/en/kibana/current/_configuring_kibana_on_docker.html

Any assistance would be appreciated as using env variables is more convenient in our environment.
Thanks.

Hi @musicksoft,

I just tried to reproduce your problem by running

 docker run -e SERVER_BASEPATH=/foo -p 5601:5601 --link elasticsearch docker.elastic.co/kibana/kibana:5.2.1

but it worked fine for me. Could you provide more details about your deployment environment and the way you are starting the container?

Hi, thanks for the reply. I'm using the default Docker registry and running:

docker run -e SERVER_BASEPATH=/foo -p 5601:5601 --link elasticsearch kibana:5.2.1

This image appears not to support all the env variables. I switched to try the docker.elastic.co image, but it has XPack installed which we are not currently using.

The image in the official docker registry is not created and unsupported by Elastic!

It is correct that the official docker image at docker.elastic.co/kibana/kibana:5.2.1 includes X-Pack. If you don't want to use the X-Pack features you can disable them by setting

  • xpack.security.enabled: false or the environment variable XPACK_SECURITY_ENABLED=false
  • xpack.monitoring.enabled: false or the environment variable XPACK_MONITORING_ENABLED=false

in the kibana.yml (and the elasticsearch.yml if you're running Elasticsearch from the image at docker.elastic.co/elasticsearch/elasticsearch:5.2.1). You might also choose to use X-Pack with the free basic license which still provides quite some advantages such as single-cluster monitoring, search profiling and improved map zoom levels.

Hi, I switched over to the elastic.co images, but now my problem is disabling Xpack security via environment variables. I am able to disable it via the kibana.yml and elasticsearch.yml config files. However, when i use XPACK_SECURITY_ENABLED=false it is not disabled. I get a basic auth challenge in Kibana and this error in elasticsearch:
Error: [security_exception] missing authentication token for REST request [/content-index-read/content/_search], with { header={ WWW-Authenticate="Basic realm="security" charset="UTF-8"" } }

I'm launching the images using compose:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.1
ports:
- 9200:9200
environment:
- XPACK_SECURITY_ENABLED=false
- XPACK_MONITORING_ENABLED=false
kibana:
image: docker.elastic.co/kibana/kibana:5.2.1
ports:
- 5601:5601
environment:
- XPACK_SECURITY_ENABLED=false
- XPACK_MONITORING_ENABLED=false

I have confirmed that the environment variables have been set within the container.
Any help would be great.

Sorry for the long delay, @musicksoft. It looks like the way the wrapper script of the Elasticsearch docker image is parsing the environment variables differently from the Kibana image. The variable needs to have the same name as the setting in the elasticsearch.yml would have. In this case is it would be

image: docker.elastic.co/elasticsearch/elasticsearch:5.2.1
environment:
  - xpack.security.enabled=false
  - xpack.monitoring.enabled=false

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