MySQL database deadlocks when running Midori "Better Content Archiving for Confluence" app on large spaces

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

Summary

When using the Better Content Archiving for Confluence app to archive large spaces, database deadlocks are observed in the logs and the archiving process appears to take very long to complete. Additionally, you will not be able to edit or create new pages in the space being archived while the archive job is running. 

Environment

Confluence 6.x

MySQL 5.x

Diagnosis

The following will be observed in the logs:

1 WARN [Long running task: Content Archiving
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 WARN [Long running task: Content Archiving [CARCH]] [confluence.util.profiling.DurationThresholdWarningTimingHelperFactory] logMessage Execution time for publishing event com.atlassian.confluence.event.events.content.page.PageMoveEvent@1a3b0421[theMover=ConfluenceUserImpl{name='username', key=1a2345b678de90123456fg7890h12345},oldSpace=Space{key='XYZ'},oldParentPage=page: Page Title (123456789),oldPosition=<null>,movedBecauseOfParent=false,movedPageList=[page: Page Title (123456789)],page=page: Page Title (123456789),suppressNotifications=false,timestamp=1554129041728] took 7376 ms (warning threshold is 5000 ms) -- space: 2 | url: /wiki/cf/archiving/launch-archiving.action | traceId: de8fb9577bf017c3 | userName: xxxxx | referer: https://hostname/wiki/cf/archiving/start-archiving.action?key=XYZ | action: launch-archiving WARN [Caesium-1-3] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions: ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1890880602) ERROR [Caesium-1-3] [impl.schedule.caesium.JobRunnerWrapper] runJob Scheduled job com.atlassian.confluence.plugins.confluence-notifications-batch-plugin:batchingJob#batchingJobConfig failed to run com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:MySQL - version:5.6.23-log - minor version:6 - major version:5 ERROR [http-nio-8090-exec-20] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Lock wait timeout exceeded; try restarting transaction -- referer: https://hostname/wiki/cf/pages/resumedraft.action?draftId=123456789&draftShareId=12a34bc5-678d-9e1a-b123-4c56d7890e12 | url: /wiki/cf/rest/api/content/212207606 | traceId: e4c385f1bf7c34c8 | userName: username ERROR [http-nio-8090-exec-7] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : -- referer: https://hostname/wiki/cf/pages/resumedraft.action?draftId=123456789&draftShareId=12a34bc5-678d-9e1a-b123-4c56d7890e12 | url: /wiki/cf/rest/api/content/212207606 | traceId: aeef30990a0c5b66 | userName: username javax.persistence.PersistenceException: org.hibernate.exception.LockAcquisitionException: could not execute statement

Cause

Unknown. If the solution proposed in this KB doesn't apply to your case or is ineffective, we recommend reaching out to Vendor Support here.

Solution

It has been observed that this problem does not exist in MySQL versions higher than 5.x

Updated on March 19, 2025

Still need help?

The Atlassian Community is here for you.