Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Move Instance from Windows to Linux

Andre Eikermann April 19, 2018

Hi,

i try to move Bitbucket from Windows to Linux (Ubuntu).

Bitbucket 5.9.1
MySQL 5.7

I've copied the installation- and home-directory, and move the database via dump to the new machine.  I made changes all needed changes to the config files (databasse, home-dir, permissions on files).

 

When i know try to start Bitbucket i get this error:

2018-04-19 13:08:02,549 INFO  [main]  o.s.boot.SpringApplication
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v1.5.10.RELEASE)


2018-04-19 13:08:02,729 INFO  [main]  c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication on web-mbr-111-u.oediv.lan with PID 33992 (/srv/bitbucket/bin/5.9.1/app/WEB-INF/classes started by atlbitbucket in /srv/bitbucket/data/log)
2018-04-19 13:08:02,729 INFO  [main]  c.a.b.i.b.BitbucketServerApplication No active profile set, falling back to default profiles: default
2018-04-19 13:08:04,002 INFO  [main]  c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 5.9.1 (ad7f50c built on Tue Apr 03 06:45:15 CEST 2018)
2018-04-19 13:08:04,002 INFO  [main]  c.a.b.i.boot.log.BuildInfoLogger JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.8.0_152-b16
2018-04-19 13:08:05,469 INFO  [main]  c.a.b.i.b.BitbucketServerApplication Started BitbucketServerApplication in 3.963 seconds (JVM running for 6.727)
2018-04-19 13:08:08,477 INFO  [spring-startup]  c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /srv/bitbucket/data
2018-04-19 13:08:11,340 ERROR [spring-startup]  liquibase classpath:liquibase/bootstrap.xml: liquibase/r3_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch: Change Set liquibase/r3_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch failed.  Error: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
2018-04-19 13:08:11,346 WARN  [spring-startup]  o.s.w.c.s.XmlWebApplicationContext Exception encountered during context initialization - cancelling refresh attempt: 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:/srv/bitbucket/bin/5.9.1/app/WEB-INF/lib/bitbucket-service-impl-5.9.1.jar!/com/atlassian/stash/internal/license/DefaultLicenseHelper.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapLiquibase' 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_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
2018-04-19 13:08:11,354 INFO  [spring-startup]  c.a.s.internal.home.HomeLockAcquirer Releasing lock on /srv/bitbucket/data
2018-04-19 13:08:11,357 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:/srv/bitbucket/bin/5.9.1/app/WEB-INF/lib/bitbucket-service-impl-5.9.1.jar!/com/atlassian/stash/internal/license/DefaultLicenseHelper.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapLiquibase' 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_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    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 '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:/srv/bitbucket/bin/5.9.1/app/WEB-INF/lib/bitbucket-service-impl-5.9.1.jar!/com/atlassian/stash/internal/license/DefaultLicenseHelper.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapLiquibase' 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_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
    ... 5 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'licenseHelper' defined in URL [jar:file:/srv/bitbucket/bin/5.9.1/app/WEB-INF/lib/bitbucket-service-impl-5.9.1.jar!/com/atlassian/stash/internal/license/DefaultLicenseHelper.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapLiquibase' 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_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    ... 5 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapLiquibase' 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_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
    ... 5 common frames omitted
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase/r3_4/bootstrap-upgrade.xml::STASHDEV-7910-1::jhinch:
     Reason: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
    at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
    at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
    at liquibase.Liquibase.update(Liquibase.java:214)
    at liquibase.Liquibase.update(Liquibase.java:192)
    at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:431)
    at liquibase.database.ExtendedSpringLiquibase.afterPropertiesSet(ExtendedSpringLiquibase.java:32)
    ... 5 common frames omitted
Caused by: liquibase.exception.DatabaseException: Table 'app_property' already exists [Failed SQL: CREATE TABLE bitbucket.app_property (prop_key VARCHAR(50) NOT NULL, prop_value VARCHAR(2000) NOT NULL, CONSTRAINT PK_APP_PROPERTY PRIMARY KEY (prop_key))]
    at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
    at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
    at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
    at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
    at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
    ... 11 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'app_property' already exists
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.Util.getInstance(Util.java:408)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2482)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2440)
    at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
    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:307)
    ... 16 common frames omitted

 

Any idea what's going wrong?

Best regards

André

 

1 answer

1 accepted

2 votes
Answer accepted
Rodrigo M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 19, 2018

Hey Andre

From the log it appears that there are multiple failures and the recent one is that related to the database inconsistency. It appears that Bitbucket is trying to create a table  as part of an upgrade which already exists. I could see that latest version of bitbucket is being started.

Did you have the opportunity to take a look at the Migrating Bitbucket Server to another server document?

In any case, I would recommend you trying the migration using the bitbucket backup client.

Regards!
Rodrigo

Andre Eikermann April 24, 2018

Hi Rodrigo,

using the bitbucket backup client was the clue.

Thanks!

Best Regards

André

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events