Bitbucket Server Does Not Start - Wrong column type
Symptoms
Bitbucket Server fails to start after a server reboot. The following appears in the atlassian-bitbucket.log
:
2013-04-11 17:28:41,712 ERROR [main] o.s.web.context.ContextLoader Context initialization failed
...
Caused by: org.hibernate.HibernateException: Wrong column type in PUBLIC.PUBLIC.PLUGIN_STATE for column enabled. Found: boolean, expected: bit
... 97 common frames omitted
or:
Caused by: org.hibernate.HibernateException: Wrong column type in stash.plugin_state for column enabled. Found: tinyint, expected: bit
Cause
Scenario 1:
Bitbucket Server is attempting to start with binaries that are older than the version of the Bitbucket Server data in BITBUCKET_HOME
. It is likely that there are more than one Bitbucket Server installations on the server.
Scenario 2:
The Database driver in use doesn't match what is recommended for the specific Bitbucket Server version. In this case, customer was running Bitbucket Server version 3.2.4 and the MySQL driver used was mysql-connector-java-3.0.16. This needed to be updated to/ replaced with mysql-connector-java-5.1.38 .
Resolution
Scenario 1
Scenario 2
Check the "Connecting Bitbucket Server to an external database" documentation that pertains to the specific version of Bitbucket Server being run and ensure the proper driver is being used.