Bitbucket Server as a service and the database as currently configured is not accessible error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

If Bitbucket Server is configured as a service on Windows, the following appears on the UI when it is started by the service:

1 2 3 4 A fatal error has occurred The following problem occurred which prevents Atlassian Bitbucket Server from starting correctly: The database, as currently configured, is not accessible. Bitbucket Server is configured to use the mysql driver (com.mysql.jdbc.Driver) but it is not available. Please follow the instructions to install the driver as per Connecting Bitbucket Server to MySQL.

However, when starting Bitbucket Server manually from its binary works just fine.

Cause

The database connector lib was not in the correct place. The driver when placed under <Bitbucket home directory>/lib only works when manually starting Bitbucket Server.

Resolution

As a workaround, place the MySQL jar connector (mysql-connector-java-5.1.x-bin.jar) under <BITBUCKET_INSTALLATION_DIR>/app/WEB_INF/lib instead if you are starting Bitbucket Server as a service.

This is not given as a primary guideline on Connecting Bitbucket Server to MySQL because the driver would be lost when upgrading Bitbucket Server. Hence, if you upgrade Bitbucket Server at this stage you will need to perform this again.

The final fix was included in BSERV-3163 - Driver not available when running Stash as Windows service using $STASH_HOME/lib.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.