Bitbucket Mesh Sidecar H2 database migration

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

Summary

When accessing a repository via the web user interface an error occurs saying "Repository not available - offline. The repository will be available once the Bitbucket Mesh node is online".

Environment

Bitbucket Data Center version 8 or newer, which Mesh Sidecar enabled.

Diagnosis

The <Bitbucket home>/log/atlassian-bitbucket.log will show an error such as the following:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2024-01-09 15:45:41,940 WARN [mesh-sidecar-monitor:thread-1] c.a.s.i.s.g.m.DefaultSidecarManager Sidecar has not fully started after 5609ms. Bitbucket will continue starting. More details may be available in the Mesh logs 2024-01-09 15:45:41,941 WARN [mesh-sidecar-monitor:thread-1] c.a.s.i.s.g.m.DefaultSidecarManager atlassian-mesh.log: WARN [main] - o.s.c.a.AnnotationConfigApplicationContext Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseValidator' defined in com.atlassian.bitbucket.mesh.MeshDatabaseWiring: Invocation of init method failed; nested exception is com.atlassian.bitbucket.mesh.UnsupportedH2StoreException: The storage format for the internal database that you are using has changed and requires manual migration. 2024-01-09 15:45:41,941 ERROR [mesh-sidecar-monitor:thread-1] c.a.s.i.s.g.m.DefaultSidecarManager atlassian-mesh.log: ERROR [main] - o.s.b.d.LoggingFailureAnalysisReporter *************************** APPLICATION FAILED TO START *************************** Description: The storage format for the internal database that you are using has changed and requires manual migration. Action: Please perform the manual migration of the database. See https://confluence.atlassian.com/bitbucketserver088/migrate-h2-database-1216583295.html.

Cause

The Mesh Sidecar process unable to come up due to H2 database is not migrated. Even if Mesh has not been enabled, Bitbucket Server uses the local Mesh Sidecar process to handle requests that require interaction with git processes.

Solution

  1. Manually perform the H2 database migration as per Migrate H2 database OR

  2. Let Bitbucket rebuild the H2 database during the startup:

    1. Stop Bitbucket service and ensure that there are no other Java processes running, you can use the following command: 

      1 ps -ef | grep java
    2. Rename the following files if they exist (append.bacinto the filename):

      1. <Bitbucket home>/mesh/mesh.mv.db

      2. <Bitbucket home>/mesh/mesh.trace.db

    3. Start Bitbucket service.

Updated on March 11, 2025

Still need help?

The Atlassian Community is here for you.