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
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:
Microsoft SQL Server
12.00.5000
jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
1.3.1
Summary of items that seem to prevent correlation:
I hope this information is helpful!
Nate Hansberry
Atlassian Developer Tools Support
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.