Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket Server fails to start on upgrade springMVC dispatcher error

We are attempting to upgrade our Bitbucket server from 5.3.0 to 6.1.0.  Everytime we do we get the "SpringMVC dispatcher [springMvc] could not be started" screen in the browser.  Everything I have found is said to be database related so I created a new environment with a new fresh empty DB and connected it to 5.30 and it still breaks when upgrading to 6.1.0.

This is the error in the log:

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:/apps/products/atlassian/bitbucket/6.10.1/app/WEB-INF/lib/bitbucket-service-impl-6.10.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (db_owner) 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:/apps/products/atlassian/bitbucket/6.10.1/app/WEB-INF/lib/bitbucket-service-impl-6.10.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (db_owner) 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:/apps/products/atlassian/bitbucket/6.10.1/app/WEB-INF/lib/bitbucket-service-impl-6.10.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 java.lang.RuntimeException: Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (db_owner) 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 (db_owner) 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 (db_owner) 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

2 answers

@Christopher Gronde 

 

Hi Christopher

 

based on

 Cannot use default schema name dbo on Microsoft SQL Server because the login schema of the current user (db_owner) is different and MSSQL does not support setting the default schema per session.

 

How are the permissions set for the database that you use and especially for the user that you use?

https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-sql-server-776640385.html lists all the needed configs.

Cheers

Kurt

Kurt,

I verified with our DBA that everything is set up correctly as per this document.  He even sent me a screenshot showing me that the user is in the db_owner role as per the document.  I am still getting the same error.  This worked in 5.3 just fine.  I wasn't until we tried upgrade to 6.10.1 that this became an issue.  

0 votes

Hi Everyone!

The above issue can be fixed by changing the default schema of the bitbucket user to dbo instead of db_owner.

This can be done in the MSSQL GUI or via SQL statement (see MSSQL Documentation).

In addition to researching this subject I was able to run a test. Based on the results I am unable to conclude that upgrading Bitbucket Server from 5.X to 6.10.1 will lead to this issue.

 

Test Outline:

  • spin up a mssql db
     
    Microsoft SQL Server
    12.00.5000
    jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
    1.3.1
    
  • connect bbs 5.3.0 to the mssql db
  • query default schema of bitbucketuser -> default schema is dbo
  • upgrade bbs to 6.10.1
  • query default schema of bitbucketuser -> default schema is still dbo

Summary of items that seem to prevent correlation:

  • Our documentation doesn't mention any SQL statement that creates a relationship between the bitbucketuser and the db_owner or the dbo schema; This appears to be handled by MSSQL
  • The default schema did not change as a result of an upgrade during the test

 

I hope this information is helpful!

 

Nate Hansberry

Atlassian Developer Tools Support

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,922 views 0 7
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