ElasticSearch fails to start (java.lang.RuntimeException: starting java failed) in Bitbucket Server

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.

Summary

Elasticsearch service fails to start with the 'Error opening log file 'logs/gc.log': Permission denied' error.

Environment

Bitbucket Server 7.6.0 with Bundled ES. It can happen in any version of Bitbucket.

Diagnosis

Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
Nov 13 17:19:25 sso-services-ppr start-bitbucket.sh[16873]: output:
Nov 13 17:19:25 sso-services-ppr start-bitbucket.sh[16873]: [0.002s][error][logging] Error opening log file 'logs/gc.log': Permission denied
Nov 13 17:19:25 sso-services-ppr start-bitbucket.sh[16873]: [0.002s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=5,filesize=20M' failed.

Cause

The Bitbucket installation folder - /$BITBUCKET_INSTALL/elasticsearch/logs - doesn't have the write permissions for the Bitbucket user.

Solution

Change the permission of the folder above to have write permissions for the Bitbucket user.

Last modified on Oct 18, 2021

Was this helpful?

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