After upgrading Atlassian Stash v3.8.0 to Bitbucket v-5.14.0 no longer loading & showing below error -
+++++++++++++++++++++++
A fatal error has occurred
The following problem occurred, which prevents Atlassian Bitbucket from starting:
- The database schema could not be updated. Details about the change that failed can be found in the logs.
It may be necessary to create a ticket to resolve the error. When creating a ticket, please include the exception details from the logs, as well as the database type.
++++++++++++++++++++
Bitbucket error log-
++++++++++++++++++++
2018-09-26 13:22:08,993 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.MigrationFailedException: Migration failed for change set liquibase/r3_9/upgrade.xml::STASH-7119-1::jpalacios:
Reason: liquibase.exception.DatabaseException: Table 'sta_deleted_group' already exists [Failed SQL: CREATE TABLE bitbucket.sta_deleted_group (id BIGINT NOT NULL, name VARCHAR(255) NOT NULL COMMENT 'group name', deleted_timestamp DATETIME NOT NULL COMMENT 'deleted date', CONSTRAINT pk_sta_deleted_group PRIMARY KEY (id), CONSTRAINT uq_sta_deleted_group_name UNIQUE (name))]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:667)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at java.lang.Thread.run(Thread.java:748)
... 18 frames trimmed
Caused by: 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.MigrationFailedException: Migration failed for change set liquibase/r3_9/upgrade.xml::STASH-7119-1::jpalacios:
Reason: liquibase.exception.DatabaseException: Table 'sta_deleted_group' already exists [Failed SQL: CREATE TABLE bitbucket.sta_deleted_group (id BIGINT NOT NULL, name VARCHAR(255) NOT NULL COMMENT 'group name', deleted_timestamp DATETIME NOT NULL COMMENT 'deleted date', CONSTRAINT pk_sta_deleted_group PRIMARY KEY (id), CONSTRAINT uq_sta_deleted_group_name UNIQUE (name))]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
... 5 common frames omitted
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/r3_9/upgrade.xml::STASH-7119-1::jpalacios:
Reason: liquibase.exception.DatabaseException: Table 'sta_deleted_group' already exists [Failed SQL: CREATE TABLE bitbucket.sta_deleted_group (id BIGINT NOT NULL, name VARCHAR(255) NOT NULL COMMENT 'group name', deleted_timestamp DATETIME NOT NULL COMMENT 'deleted date', CONSTRAINT pk_sta_deleted_group PRIMARY KEY (id), CONSTRAINT uq_sta_deleted_group_name UNIQUE (name))]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:78)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:317)
at liquibase.database.ExtendedSpringLiquibase.afterPropertiesSet(ExtendedSpringLiquibase.java:32)
... 5 common frames omitted
Caused by: liquibase.exception.DatabaseException: Table 'sta_deleted_group' already exists [Failed SQL: CREATE TABLE bitbucket.sta_deleted_group (id BIGINT NOT NULL, name VARCHAR(255) NOT NULL COMMENT 'group name', deleted_timestamp DATETIME NOT NULL COMMENT 'deleted date', CONSTRAINT pk_sta_deleted_group PRIMARY KEY (id), CONSTRAINT uq_sta_deleted_group_name UNIQUE (name))]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600)
... 11 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'sta_deleted_group' already exists
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4208)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4140)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2597)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2758)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2769)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:907)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:791)
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352)
... 16 common frames omitted
+++++++++++++++++++++++++++++++
I am using MySQL 5.6.