An error stating "multiple primary keys for table 'plugin_setting' are not allowed" occurs during the startup of Bitbucket Data Center.

Platform Notice: Data Center Only - This article only applies to Atlassian apps 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

Solution

Summary:

When launching a new Bitbucket instance, the startup fails with the following error.

Environment:

The solution has been validated in Bitbucket Data Center 9.2.1 but may apply to other versions.

This only affects Bitbucket Data Center running with:

Diagnosis:

Theatlassian-bitbucket.logwill have the following events.

Cause:

  • Typically, during the initial startup of Bitbucket 9.2.1, 874 Liquibase change sets are applied. However, in this particular case, only 803 are detected.

  • The reason some of the change sets are being skipped is that the changesets are defined for the supported Postgres database and not the EDB Postgres database.

  • As outlined in the Liquibase documentation, Postgres and EDB Postgres use different DBMS short names. Consequently, any change set specifically released for Postgres with the DBMS set as "postgresql" will not execute on the EDB database. This is why the total number of change sets applied to EDB is lower than the actual number of change sets applied on PostgreSQL.

  • For example, the changeset with ID STASHDEV-6754-4b, which contains a statement to drop the primary key on the 'key_name' and 'namespace' columns from the 'plugin_setting' table, is specified for the DBMS "postgresql" and therefore is not executed in the EDB Postgres database.

    Because the changeset STASHDEV-6754-4b wasn't applied, the subsequent changeset, STASHDEV-6754-5, which includes a statement to add a primary key to the 'id' column of the 'plugin_setting' table, could not be executed due to the database restriction that prevents a table from having multiple primary keys.

Solution:

  • Currently, Bitbucket Data Center does not support the EDB Postgres database, which is why change sets are not released for it. Although there is a feature request BSERV-13227 to include EDB Postgres as a supported database, it's recommended to use one of the currently supported database types.

  • In case of any confusion, kindly reach out to Atlassian support.

Updated on September 26, 2025

Still need help?

The Atlassian Community is here for you.