Unable to delete projects in Jira Server or Data Center with SQLException: Lock wait timeout exceeded; try restarting transaction


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

The Jira admin is unable to delete projects which is failing with the following error in the <jira-home>/log/atlassian-jira.log:

/secure/project/DeleteProject.jspa [c.a.jira.project.DefaultProjectManager] Exception removing issues
com.querydsl.core.QueryException: Caught SQLException for delete from customfieldvalue
where customfieldvalue.issue = ?
	at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
	...
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

Diagnosis

This type of error typically occurs when a transaction is waiting on row(s) of data to update which is already locked by another transaction. 


show variables like '%wait_timeout%';
show variables like '%tx_isolation%';
SELECT @@GLOBAL.tx_isolation, @@tx_isolation;

Cause

If everything above is configured properly, the issue could be caused by incompatible 3rd-party listeners and custom fields. See JRASERVER-70522 - Updating custom field value during issue deletion can cause stuck threads for more information.

Solution

Enter Safe Mode and attempt to delete the projects.

If these steps don't resolve the issue, there may be another root cause – please reach out to Atlassian Support with a Support Zip from your instance.



Last modified on Jan 31, 2025

Was this helpful?

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