Bitbucket Server Does Not Start - Missing column: remote_address_binary
Symptoms
Bitbucket Server cannot be started and the message below can be found on the logs.
The following appears in the atlassian-bitbucket.log
:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pluginStateDao' defined in URL [jar:file:/path/to/atlassian-bitbucket-2.1.2/atlassian-bitbucket/WEB-INF/lib/bitbucket-dao-impl-.1.2.jar!/com.atlassian.bitbucket/internal/plugin/HibernatePluginStateDao.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'sessionFactory' defined in class path resource [bitbucket-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [bitbucket-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: remote_address_binary in PUBLIC.PUBLIC.CWD_APPLICATION_ADDRESS; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bitbucket-context.xml]: Cannot resolve reference to bean 'sessionFactoryPrototype' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [bitbucket-context.xml]: Invocation of init method failed; *nested exception is org.hibernate.HibernateException: Missing column: remote_address_binary in PUBLIC.PUBLIC.CWD_APPLICATION_ADDRESS*
Cause
This error happens when the Bitbucket Server application binary files are of an earlier version than the Bitbucket Server data files located in the BITBUCKET_HOME
directory.
Let's suppose that we have these folders and sym link file:
/applications/bitbucket_home
/applications/bitbucket-2.4.1
/applications/bitbucket-2.5.1
/applications/bitbucket that is a symlink to /applications/bitbucket-2.4.1 (
)
-> /applications/bitbucket-2.4.1e.g. bitbucket
If the Bitbucket Server from "/applications/bitbucket-2.5.1" is started it will upgrade the installation of /applications/bitbucket_home to 2.5.1, so if you start the instance installed on "/applications/bitbucket-2.4.1" (or starting by way of the symlink) the error above will be presented on the logs because the version mismatch by the installation folder and the BITBUCKET_HOME.
Resolution
Start Bitbucket Server with binaries that are of equal or higher version (upgrade) than the version of data in BITBUCKET_HOME
.