Bamboo fails to start up - Failed to run pre-bootstrap upgrade tasks, multiple entries in the HIBERNATE_UNIQUE_KEY

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Problem

Bamboo is failing to start up and the following error message can be found inside the <bamboo-home-directory>/logs/atlassian-bamboo.log file:

2015-11-17 19:50:22,327 INFO [localhost-startStop-1] [AbstractUpgradeManager] Completed task 4300 with errors.
2015-11-17 19:50:22,327 FATAL [localhost-startStop-1] [DefaultBootstrapManager] Pre-bootstrap validation tests failed: [Task for build 4300 failed:, com.atlassian.bamboo.upgrade.tasks.validation.ThereIsSingleRowInHibernateUniqueKeyTable: multiple entries in the HIBERNATE_UNIQUE_KEY table]

Diagnosis

Run the following SQL query against your Bamboo database:

select * from HIBERNATE_UNIQUE_KEY;

This will return the value of the next_hi column.

Cause

There are several values under the next_hi column inside the HIBERNATE_UNIQUE_KEY table, whereas there should be only one, so Bamboo reports the following error:

multiple entries in the HIBERNATE_UNIQUE_KEY table

Workaround

The workaround is to remove the additional entries inside the HIBERNATE_UNIQUE_KEY table directly from the database.

  1. Shutdown Bamboo.
  2. Run the following SQL query in your Bamboo database:

    select * from HIBERNATE_UNIQUE_KEY;
  3. This will return something like this (values may vary):

    select * from HIBERNATE_UNIQUE_KEY;
     next_hi 
    ---------
        3997
          13
        3997
        3997
        3997
        3999
    (6 rows)
  4. Choose the higher value from the result of the previous SQL query and run the following delete:

    (!) Always backup your database before applying any changes.
    delete from HIBERNATE_UNIQUE_KEY where next_hi < 3999; 

    This will delete all values lower than 3999 from the next_hi column inside the HIBERNATE_UNIQUE_KEY table.

  5. Run the SQL query from Step 2 again to make sure there's only one value now:

    select * from HIBERNATE_UNIQUE_KEY;
     next_hi 
    ---------
        3999
    (1 row)
  6. Start Bamboo.

Last modified on Apr 14, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.