When using the root user, Elasticsearch cannot be started due to "don't run elasticsearch as root"

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem

Elasticsearch cannot be started, therefore Bitbucket Server cannot connect to it.

The following appears in the console output when running the start-search.sh or the start-bitbucket.sh script or the :

root@myserver:/home/stash/shared/search# cd /opt/atlassian/bitbucket/4.9.1/bin/
root@myserver:/opt/atlassian/bitbucket/4.9.1/bin# sh start-search.sh 
Starting Elasticsearch bundled with Atlassian Bitbucket
BITBUCKET_HOME set to /var/atlassian/application-data/bitbucket
-e Starting Elasticsearch bundled with Atlassian Bitbucket as current user
-e 
Elasticsearch bundled with Atlassian Bitbucket started successfully
root@myserver:/opt/atlassian/bitbucket/4.9.1/bin# Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

Diagnosis

Environment

  • Operating system: Unix based 

Cause

Elasticsearch cannot be run as root.

Resolution

  • Login as the atlbitbucket user
  • Run the start script


DescriptionElasticsearch cannot be started, therefore Bitbucket Server cannot connect to it.
Last modified on Jan 2, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.