Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,477
Community Members
 
Community Events
165
Community Groups

The target database contains tables whose names collide with Bitbucket's tables

We migrated our on-premise bitbucket server to AWS Outposts. But we still  decided to use our old Microsoft SQL Server. When pointing  the old DB to new BitBucket server this is the error we are  getting,

 

The target database contains tables whose names collide with Bitbucket's tables. Please migrate to a clean, empty database. For more information about creating a database for use with Bitbucket, please refer to the Bitbucket documentation.
	com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:226)
	com.atlassian.stash.internal.migration.DefaultDatabaseMigrationService.validateConfiguration(DefaultDatabaseMigrationService.java:85)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	...

Is there a  way around to solve this problem without having to create a new empty DB and copy the old DB to it ? 

Thank you in advance! 

3 answers

2 accepted

0 votes
Answer accepted

Thanks @Nic Brough _Adaptavist_ for your suggestions. I figured out the problem, it was related to the connectivity to domain name. The new server could not connect by using the hostname it needed full hostname. I added that in properties file and everything started working.

0 votes
Answer accepted

This sounds like you created a new, clean, Bitbucket installation on the AWS machine, but pointed it to an existing database.

This has confused the startup process because it is expecting to be connected to an empty database because it's a new installation of Bitbucket.

It is not hard to fix, the installation stops dead and doesn't do any damage.

You have two routes here broadly, either manually reconfiguring the new install so that it believes it is complete and your old database is valid, or letting it finish the installation with an empty database which you can then discard, and flip it over to the old one.

@Nic Brough _Adaptavist_ how do you make it believe that the installation is complete and old DB is valid ? Since  the installation in AWS machine is already done and I can access the user interface where it is asking me to set up the database.

I did point the database to  internal and once the set up is ready I reconfigured the 

bitbucket.properties file to point to the My sql DB and restarted the  service but seems like it still does not like it. This  is what I  get in browser,

A fatal error has occurred

The following problem occurred, which prevents Atlassian Bitbucket from starting:

  • SpringMVC dispatcher [springMvc] could not be started

 

We'd need to see more of the log to see what the underlying error is there.

I can't remember off the top of my head how to fake the installation status, the clean and repoint is what we usually do.  I do remember the one time we persevered with it, it involved setting up a second copy from scratch and manually comparing the installation files

Ok, the error says your database is misconfigured - see "Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session."

The database is actually the same from old BitBucket server. We are just pointing the new server to existing database. So I think the database is configured correctly.

Another thing I noticed is, I am seeing this log when the service is started, I am wondering if this is causing the issue ? Does the service  needs to be run by root  user or any specific user  ?

 

The following issues were found with the mask "u=rwx,g=rx,o=rx" (0022):

- Access is allowed to 'others'. It is recommended that 'others' be denied

all access for security reasons.

The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be

configured in _start-webapp.sh

Sorry, I meant the configuration of the connection to the database - the error message is telling you the user does not have the right access.

Hi @Nic Brough _Adaptavist_ thank you for response. I am attaching the log files, please let me know if there is anything I can try to  resolve the issue. Also if you happened to know the work around without creating  new empty DB please let me  know.



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:/data/atlassian-bitbucket-6.10.0/app/WEB-INF/lib/bitbucket-service-impl-6.10.0.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session.

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:676)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)

        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:/data/atlassian-bitbucket-6.10.0/app/WEB-INF/lib/bitbucket-service-impl-6.10.0.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session.

        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:314)

        ... 5 common frames omitted

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'licenseHelper' defined in URL [jar:file:/data/atlassian-bitbucket-6.10.0/app/WEB-INF/lib/bitbucket-service-impl-6.10.0.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session.

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769)

        ... 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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session.

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)

        ... 5 common frames omitted

Caused by: java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (guest) is different and MSSQL does not support setting the default schema per session.

        at liquibase.database.core.MSSQLDatabase.setDefaultSchemaName(MSSQLDatabase.java:118)

at liquibase.database.ExtendedSpringLiquibase.createDatabase(ExtendedSpringLiquibase.java:51)

        at liquibase.integration.spring.SpringLiquibase.createLiquibase(SpringLiquibase.java:324)

        at liquibase.database.ExtendedSpringLiquibase.afterPropertiesSet(ExtendedSpringLiquibase.java:32)

        ... 5 common frames omitted

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,214 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you