SpringMVC dispatcher could not be started

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

Bitbucket Server fails to startup.

The following message is displayed on the UI:

The following problem occurred which prevents Atlassian Bitbucket Server from starting correctly:


SpringMVC dispatcher [springMvc] could not be started

Cause

There are different root causes for this problem.

  1. Cause #1:
    The following exception is reported in the atlassian-bitbucket.log file:
    catalina.out
    15:08:16,767 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[bitbucket.application] - openFile(/var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.log,true) call failed. java.io.FileNotFoundException: /var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.log (Permission denied)
    	at java.io.FileNotFoundException: /var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.log (Permission denied)
    	at 	at java.io.FileOutputStream.open(Native Method)
    	at 	at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    	at 	at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
    	at 	at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
    	at 	at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
    	at 	at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:86)
    	at 	at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
    	at 	at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
    	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
    	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
    	at 	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
    	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
    	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
    	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
    	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
    	at 	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
    	at 	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
    	at 	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    	at 	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    	at 	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
    	at 	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
    	at 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
    	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
    	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
    	at 	at com.atlassian.bitbucket.internal.lifecycle.DefaultStartupManager.<clinit>(DefaultStartupManager.java:18)
    	at 	at com.atlassian.bitbucket.internal.spring.Bitbucket ServerWebApplicationInitializer.onStartup(Bitbucket ServerWebApplicationInitializer.java:65)
    	at 	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
    	at 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
    	at 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	at 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    	at 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    	at 	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    	at 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at 	at java.lang.Thread.run(Thread.java:744)

    In this case, /var/atlassian/application-data/bitbucket/, which is being used as Bitbucket Server Home Directory, is not accessible to the user running Bitbucket Server. The permissions on the directories contained within <Bitbucket home directory> might be mixed where the user running Bitbucket Server is not the same.

    For further steps on how to diagnose this please see - How to View Detailed permissions for Bitbucket Server directory

  2. Cause #2:
    The following exception is reported in the atlassian-bitbucket.log file:

    2018-07-08 01:01:11,128 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.DatabaseException: java.sql.SQLTransientConnectionException: bitbucket - Connection is not available, request timed out after 15000ms.
    	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.DatabaseException: java.sql.SQLTransientConnectionException: bitbucket - Connection is not available, request timed out after 15000ms.
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
    	... 5 common frames omitted
    Caused by: liquibase.exception.DatabaseException: java.sql.SQLTransientConnectionException: bitbucket - Connection is not available, request timed out after 15000ms.
    	at liquibase.database.jvm.JdbcConnection.getDatabaseProductName(JdbcConnection.java:43)
    	at liquibase.database.core.OracleDatabase.isCorrectDatabaseImplementation(OracleDatabase.java:210)
    	at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:111)
    	at liquibase.integration.spring.SpringLiquibase.createDatabase(SpringLiquibase.java:471)
    	at liquibase.database.ExtendedSpringLiquibase.createDatabase(ExtendedSpringLiquibase.java:40)
    	at liquibase.integration.spring.SpringLiquibase.createLiquibase(SpringLiquibase.java:437)
    	at liquibase.database.ExtendedSpringLiquibase.afterPropertiesSet(ExtendedSpringLiquibase.java:32)
    	... 5 common frames omitted
    Caused by: java.sql.SQLTransientConnectionException: bitbucket - Connection is not available, request timed out after 15000ms.
    	at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:602)
    	at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:195)
    	at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
    	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:85)
    	at com.atlassian.stash.internal.hikari.ExtendedHikariDataSource.getConnection(ExtendedHikariDataSource.java:125)
    	at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.getTargetConnection(LazyConnectionDataSourceProxy.java:403)
    	at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
    	at liquibase.database.jvm.JdbcConnection.getDatabaseProductName(JdbcConnection.java:41)
    	... 11 common frames omitted

    In this case, the database used by Bitbucket Server is unavailable.

Resolution

These are the resolutions for the root causes above:

  1. Resolution for cause #1:

    Ensure the user has sufficient read/write/execute permissions on the above folder and restart the application.

    For the example above, the following commands were run:

    $ cd /var/atlassian/application-data/bitbucket
    $ chown -R atlbitbucket:atlbitbucket *
  2. Resolution for cause #2:
    Make sure that the database service is up and running.




Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.