Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-65961

Cannot delete a project if tied with an issue with more than 2000 comments on MSSQL

XMLWordPrintable

      Summary

      With JIRA running on MSSQL, when you try to delete a project that is tied with an issue that has more than 2000 parameters markers, i.e: comments, JIRA doesn't successfully delete it. Through the UI it says it was removed and you can acknowledge it, the project will not appear on the regular dashboard panel, but the project will still be on the admin dashboard management page and on the database, missing a few schemes.

      How to reproduce

      • JIRA 7.3.1 or JIRA 7.5 running on MSSQL
      • Have an issue with more than 2000 comments (2100 on major MSSQL version > 7)
      • Try to delete this project

      Actual Result

      When trying to delete the project, eventually the following error will be logged:

      secure/project/DeleteProject.jspa [c.a.jira.project.DefaultProjectManager] Exception removing issues
      com.querydsl.core.QueryException: Caught SQLServerException for delete from dbo.jiraaction
      where jiraaction.id in (?, ?, ?, ?.... 
      	at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
      	at com.querydsl.sql.Configuration.translate(Configuration.java:459)
      	at com.querydsl.sql.dml.SQLDeleteClause.execute(SQLDeleteClause.java:222)
      	at com.atlassian.jira.issue.comments.DefaultCommentManager.lambda$deleteCommentsForIssue$4(DefaultCommentManager.java:418)
      	at com.atlassian.jira.database.DbConnectionManagerImpl.execute(DbConnectionManagerImpl.java:73)
      	at com.atlassian.jira.issue.comments.DefaultCommentManager.deleteCommentsForIssue(DefaultCommentManager.java:416)
      	at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper.removeChildActions(DefaultIssueDeleteHelper.java:172)
      	at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper.deleteIssue(DefaultIssueDeleteHelper.java:140)
      	at com.atlassian.jira.issue.managers.DefaultIssueDeleteHelper.deleteIssueNoEvent(DefaultIssueDeleteHelper.java:182)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.deleteIssueNoEvent(DefaultIssueManager.java:748)
      	at com.atlassian.jira.issue.managers.RequestCachingIssueManager.deleteIssueNoEvent(RequestCachingIssueManager.java:252)
      	at com.atlassian.jira.project.DefaultProjectManager.removeProjectIssues(DefaultProjectManager.java:420)
      	at com.atlassian.jira.project.CachingProjectManager.removeProjectIssues(CachingProjectManager.java:197
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
      

      Or

      java.sql.SQLException: Prepared or callable statement has more than 2000 parameter markers.

      The delete request may appear to have succeeded, but the project won't be deleted from the database and still be visible at the admin manage dashboard page. Since the deletion was only partial, the permission scheme may be disassociated:

      No permission scheme is associated with project 'xxx'

      Expected results

      JIRA should delete the project, treating any issues regarding the error mentioned on this ticket prior to deleting the project.

      Workaround

      Delete the issues that are preventing the project to be deleted.

              Unassigned Unassigned
              45bceedf3ee5 gkunkel1965
              Votes:
              16 Vote for this issue
              Watchers:
              17 Start watching this issue

                Created:
                Updated:
                Resolved: