Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13421

Mirror fails to start while upgrading from 6.10

    XMLWordPrintable

Details

    Description

      Issue Summary

      Mirror fails to start with a liquibase migration error when upgrading from any of the versions ranging from 6.2.x to 6.10.x. The same error also happens with a primary instance using H2 database.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Setup Bitbucket Mirror on 6.10.16 and start it.
      2. Stop Bitbucket
      3. Upgrade Bitbucket to any version which is > 8.0 after migrating the H2 database
      4. Start Bitbucket

      Expected Results

      Bitbucket should start successfully without error as the H2 DB migration is done before starting the mirror on 8.0

      Actual Results

      Bitbucket fails to start with the following error -

      2022-08-04 16:16:55,354 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 'liquibase' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/r7_0/upgrade.xml::BBSDEV-19380-3::bplump:
           Reason: liquibase.exception.DatabaseException: Index "BB_HOOK_SCRIPT_CFG_SCRIPT" belongs to constraint "FK_BB_HOOK_SCRIPT_CFG_SCRIPT"; SQL statement:
      DROP INDEX PUBLIC.bb_hook_script_cfg_script [90085-200] [Failed SQL: (90085) DROP INDEX PUBLIC.bb_hook_script_cfg_script]
      	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:767)
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
      	at java.lang.Thread.run(Thread.java:748)
      	... 19 frames trimmed
      

      Workaround

      First upgrade the Bitbucket to 7.21.3, start it, stop it and then upgrade to 8.0+ version.

      Attachments

        Activity

          People

            mgoyal2@atlassian.com Manish
            mgoyal2@atlassian.com Manish
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: