Unable to start Mirror due to database 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

Summary

Problem

When trying to start Bitbucket service on the Mirror node, it returns the following error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2023-10-31 14:25:57,159 INFO [hz.hazelcast.event-1] c.a.s.i.s.g.m.DefaultMeshSidebandRegistry Sidecar#0 ([http://localhost:7777):|http://localhost:7777):] Opening sideband channel 2023-10-31 14:25:59,489 WARN [FelixStartLevel] o.e.g.b.e.i.s.ExtenderConfiguration Gemini Blueprint extensions bundle not present, annotation processing disabled. 2023-10-31 14:26:05,237 INFO [active-objects-init-0] c.a.b.i.m.m.d.v.RepairUpstreamMappingIntegrityV1toV2 Correcting local project ids for mirror repository mappings 2023-10-31 14:26:05,257 WARN [active-objects-init-0] c.a.a.osgi.ActiveObjectsDelegate bundle [com.atlassian.bitbucket.server.bitbucket-mirroring-mirror] failed to create ActiveObjects com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:H2 - version:2.1.214 (2022-06-13) - minor version:1 - major version:2 Driver: - name:H2 JDBC Driver - version:2.1.214 (2022-06-13) org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "AO_8E6075_REPO_MAPPING" not found; SQL statement: SELECT LOCAL_ID,EXTERNAL_ID,UPSTREAM_ID,PROJECT_ID FROM AO_8E6075_REPO_MAPPING [42102-214] [...] Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "AO_8E6075_REPO_MAPPING" not found; SQL statement: SELECT LOCAL_ID,EXTERNAL_ID,UPSTREAM_ID,PROJECT_ID FROM AO_8E6075_REPO_MAPPING [42102-214] [...]

Diagnosis

  1. This installation was a normal upstream Bitbucket node before.

    OR

    The Bitbucket Home directory was copied from an existing upstream Bitbucket node before.

  2. The H2 database was used for the evaluation or the <BITBUCKET_HOME>/shared/data/db file exists.

Cause

  1. There are currently 2 statuses that an instance can assume: Default or Mirror. There are 2 places they are maintained: file system and database. This error means that they are currently in conflict. This specific situation basically happened because the installation has been defined as a Default in the database, but it is configured as Mirror on the file system.

  2. There is a property declaration in the database table app_property that is called instance.application.mode and that is defined as default. However, the file BITBUCKET_HOME/shared/bitbucket.properties.xml has application.mode=mirror.

Solution

Resolution

  1. To solve this issue, please point the installation to a new and empty Bitbucket Home directory. This will give the instance a brand new H2 database as well.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.