System hangs before starting up after upgrade to Bitbucket 7.x

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

Upgrade from Bitbucket 6.x version to 7.x, causes a strange behaviour on startup. After starting the SSH server, Bitbucket hangs for about 5 minutes and then it throws the below error message:

1 2 3 4 INFO [spring-startup] c.a.b.internal.ssh.server.SshServer Started SSH server successfully. ERROR [spring-startup] c.a.sal.core.upgrade.PluginUpgrader Upgrade failed: service matching filter=[(objectClass=com.atlassian.audit.spi.migration.LegacyAuditEntityMigrator)] unavailable org.eclipse.gemini.blueprint.service.ServiceUnavailableException: service matching filter=[(objectClass=com.atlassian.audit.spi.migration.LegacyAuditEntityMigrator)] unavailable ERROR [spring-startup] c.a.s.c.u.DefaultPluginUpgradeManager Upgrade error: Unexpected exception caught during plugin upgrade: org.eclipse.gemini.blueprint.service.ServiceUnavailableException: service matching filter=[(objectClass=com.atlassian.audit.spi.migration.LegacyAuditEntityMigrator)] unavailable

During the 5 minutes time period, the system is not available, but once it's over, it is up and running.

Diagnosis

The application logs suggest the upgrade didn't happen properly because of the plugins and the incompatible home directory:

1 2 3 ERROR [spring-startup] c.a.s.c.u.DefaultPluginUpgradeManager Upgrade error: Unexpected exception caught during plugin upgrade: org.eclipse.gemini.blueprint.service.ServiceUnavailableException: service matching filter=[(objectClass=com.atlassian.audit.spi.migration.LegacyAuditEntityMigrator)] unavailable ERROR [spring-startup] c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher [springMvc] could not be started org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeValidator' defined in class path resource [critical-context.xml]: Invocation of init method failed; nested exception is com.atlassian.stash.internal.home.IncompatibleHomeDirectoryException: The home directory has been updated by Bitbucket 7.6.1 and is no longer compatible with 6.10.5

Cause

The auditing feature is implemented in 2 separate bundled plugins:

  1. Bitbucket Server – Audit plugin:

    1 2 key: com.atlassian.bitbucket.server.bitbucket-audit version: 7.6.1
  2. Atlassian Audit plugin:

    1 2 key: com.atlassian.audit.atlassian-audit-plugin version: 1.12.1

    After testing with 7.6.2, the problem (long startup time, then the above exception) still occurred, but it was solved as soon as both audit-related plugins were disabled and re-enabled.

Solution

  1. Enabling the Bitbucket Server – Audit Plugin OR

  2. Disabling and enabling both the plugins.

Updated on February 24, 2025

Still need help?

The Atlassian Community is here for you.