Bitbucket Mesh Sidecar H2 database migration
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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 Server or 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:
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
- Manually perform the H2 database migration as per Migrate H2 database
OR - Let Bitbucket rebuild the H2 database during the startup:
Stop Bitbucket service and ensure that there are no other Java processes running, you can use the following command:
ps -ef | grep java
- Rename the following files if they exist (append .bac into the filename):
<Bitbucket home>/mesh/mesh.mv.db
<Bitbucket home>/mesh/mesh.trace.db
- Start Bitbucket service.