H2 database upgrade issue occurring while upgrading Bitbucket Data Center Mirror Instance

XMLWordPrintable

    • 1
    • Severity 2 - Major

      Issue Summary

      Bitbucket Mirror Instance was upgraded initially from 7.21.0 to 8.19.0 and then from 8.19.0 to 8.19.18 version. While trying to bring up the Bitbucket 8.19.18 mirror instance, the following issue of “H2 DB file format is no longer supported”, appeared in the logs, and the instance did not come up. As per the understanding, Mirror H2 DB should be upgraded when the user performs an upgrade from 7.21.0 to 8.19.0 version, but there was no error observed during the upgrade. And when the upgrade was done from 8.19.0 to 8.19.18 (minor version upgrade), the H2 database upgrade error was reflected in the logs.

      Steps to Reproduce

      1. Install Bitbucket Mirror Instance of 7.21.x version.
      2. Upgrade it to Bitbucket 8.19.0 (no issue with Bitbucket H2 database upgrade)
      3. Now upgrade Mirror instance 8.19.0 to 8.19.18, and while trying to bring up Bitbucket, Mirror instance, an issue with the H2 database upgrade is occurring mentioned above.

      Expected Results

      The issue should arrive for H2 database upgrade while upgrading Mirror instance from Bitbucket 7.21.x to 8.19.0, but it is occurring while upgrading from 8.19.0 to 8.19.18, which is not the correct behaviour.

      Actual Results

      The following exception is thrown in the atlassian-bitbucket.log file after upgrading to Bitbucket 8.19.18

      Error Message:

      2025-06-11 11:42:32,607 ERROR [spring-startup]  c.a.j.s.w.s.JohnsonDispatcherServlet SpringMVC dispatcher [springMvc] could not be started
      org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdAliasDao': Unsatisfied dependency expressed through method 'setSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sharedHomeLockAcquirer' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'licenseHelper' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'licenseHelper' defined in URL [jar:file:/home/ubuntu/atlassian/bitbucket/8.19.18/app/WEB-INF/lib/bitbucket-service-impl-8.19.18.jar!/com/atlassian/stash/internal/license/DefaultLicenseHelper.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'databaseSupplier' defined in URL [jar:file:/home/ubuntu/atlassian/bitbucket/8.19.18/app/WEB-INF/lib/bitbucket-dao-impl-8.19.18.jar!/com/atlassian/stash/internal/db/DefaultDatabaseSupplier.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [stash-context.xml]: Cannot create inner bean 'dataSourceFactory$created#5bda0b02' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceFactory$created#5bda0b02' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'dataSourceConfiguration' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceConfiguration' defined in class path resource [stash-context.xml]: Cannot create inner bean 'dataSourceConfigurationFactory$created#2513a811' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceConfigurationFactory$created#2513a811' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.jdbc.DataSourceConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
              at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:824)
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
              at javax.servlet.GenericServlet.init(GenericServlet.java:143)
              at java.base/java.lang.Thread.run(Unknown Source)
              ... 19 frames trimmed
      
      
      
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceConfiguration' defined in class path resource [stash-context.xml]: Cannot create inner bean 'dataSourceConfigurationFactory$created#2513a811' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceConfigurationFactory$created#2513a811' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.jdbc.DataSourceConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:389)
              ... 5 common frames omitted
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceConfigurationFactory$created#2513a811' defined in class path resource [stash-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.jdbc.DataSourceConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
              at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:646)
              ... 5 common frames omitted
      Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.jdbc.DataSourceConfiguration]: Factory method 'create' threw exception; nested exception is com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
              ... 5 common frames omitted
      Caused by: com.atlassian.stash.internal.jdbc.UnsupportedH2StoreException: H2 DB file format is no longer supported
              at com.atlassian.stash.internal.jdbc.H2DatabaseValidator.validate(H2DatabaseValidator.java:24)
              at com.atlassian.stash.internal.jdbc.DefaultDataSourceConfigurationFactory.create(DefaultDataSourceConfigurationFactory.java:48)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              ... 5 common frames omitted 

      Workaround

      Recreation of Mirror Instance.

            Assignee:
            Dyon Georgopoulos
            Reporter:
            Nitin Sharma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: