Fisheye Crucible upgrade fails with MySQL database

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The following appears in the atlassian-fisheye-<date>.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2013-06-04 14:35:15,131 ERROR - The Web context could not be started org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbControlFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cenqua.crucible.hibernate.DBControlFactoryImpl]: Constructor threw exception; nested exception is com.cenqua.crucible.hibernate.CruDBException: Problem upgrading with script /usr/lib/foong/crucible/sql/MYSQL/upgrade/upgrade_81.sql: Connection.close() has already been called. Invalid operation in this state. at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ... Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.cenqua.crucible.hibernate.DBControlFactoryImpl]: Constructor threw exception; nested exception is com .cenqua.crucible.hibernate.CruDBException: Problem upgrading with script /usr/lib/foong/crucible/sql/MYSQL/upgrade/upgrade_81.sql: Connection.close() has already been called. Invalid operation in this st ate. .. Caused by: com.cenqua.crucible.hibernate.CruDBException: Problem upgrading with script /usr/lib/foong/crucible/sql/MYSQL/upgrade/upgrade_81.sql: Connection.close() has already been called. Invalid operat ion in this state. ... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.

Cause

Due to the use of socketTimeout option in the JDBC URL, any long lasting DB statements will be interrupted with this timeout.

Workaround

Remove the socketTimeout option in the JDBC URL (FISHEYE_INST/config.xml):

1 2 3 <database type="mysql"> <connection dialect="org.hibernate.dialect.MySQL5InnoDBDialect" driver="com.mysql.jdbc.Driver" jdbcurl="jdbc:mysql://localhost/crucible?useUnicode=true&amp;characterEncoding=UTF-8&amp;socketTimeout=60000" password="crucible" username="crucible" maxPoolSize="20" minPoolSize="5" driverSource="user"/> </database>

Resolution

Upgrade to Fisheye/Crucible 3.0.2+ that has fixed the bug CRUC-6503 - Crucible upgrade may fail in the middle if DB socket timeout too short

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.