Bitbucket Server does not start - No such file or directory

Still need help?

The Atlassian Community is here for you.

Ask the community

As of Bitbucket Server 5.x+, no logs are written to the BITBUCKET_INSTALL directory. The contents of catalina.out will be written to BITBUCKET_HOME/log/atlassian-bitbucket.log file.

Problem

Bitbucket Server does not start, and no information is written to the application log files atlassian-bitbucket.log.

The following appears in catalina.out without any other information:

/opt/atlassian/bitbucket/4.11.2/bin/catalina.sh: line 385: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-1.b14.el7_2.x86_64/jre/bin/java: No such file or directory

Cause

Cause #1 - Java is not installed

Java is not installed on the server hosting Bitbucket Server, or the JAVA_HOME environment variable is not set to a valid location.

Cause #2 - Incorrect JAVA_HOME location

Bitbucket Server was installed with automated installer which creates a file containing the expected value for the JAVA_HOME variable. This file is responsible for setting the JAVA_HOME variable for Bitbucket Server itself, and will use the file's JAVA_HOME variable if there is no environmental variable set.

The JAVA_HOME location changed overtime. The variable can be found in the following file depending on the current version:

  • 5.0.0 or newer: the JAVA_HOME variable is now JRE_HOME and is set in the <Bitbucket Server installation directory>/bin/set-jre-home.sh file
  • between 4.9.0 and 5.0.0: the JAVA_HOME variable is set in the <Bitbucket Server installation directory>/bin/set-java-home.sh file
  • between 3.8.0 and 4.9.0: the JAVA_HOME variable is set in the <Bitbucket Server installation directory>/bin/setenv.sh file
  • before 3.8.0: the JAVA_HOME variable is set in the <Bitbucket Server installation directory>/bin/setenv.sh file

Cause #3 - JAVA_HOME is correct for Bitbucket, but not for Opensearch

For 7.21.0 versions or newer:

Bitbucket Server was installed with automated installer and bundled JRE, but at some point a new external Java is installed.

If you only set JAVA_HOME on <Bitbucket Server installation directory>/bin/set-jre-home.sh file, it will reflect only on Bitbucket, not on Opensearch.

Resolution

Resolution #1 - Java is not installed

Make sure that Java is installed on the server hosting Bitbucket Server by following the instructions on the Install Bitbucket Data Center from an archive file page in the "Check your version of Java" paragraph, and that the JAVA_HOME environment variable is set to a valid location.

Resolution #2 - Incorrect JAVA_HOME location

Update the JAVA_HOME environmental variable or update the appropriate file depending on the installed version to reflect the new Java location. The JAVA_HOME contains bin/java. This part of the path is found automatically.

Resolution #3 - Update JAVA_HOME inside Opensearch script

After updating JAVA_HOME on Bitbucket, it's necessary to access <Bitbucket Server installation directory>/opensearch/bin/opensearch script and change JAVA_HOME to update Opensearch variables.


Last modified on Sep 16, 2022

Was this helpful?

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