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

      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.

            [JRASERVER-65961] Cannot delete a project if tied with an issue with more than 2000 comments on MSSQL

            The fix for this issue will be delivered in our next feature release (8.21) and backported to Jira 8.13.x LTS and 8.20.x LTS after several weeks of testing and monitoring the results. This is because we take the reliability and stability of our LTS releases seriously; therefore, we purposefully delay the backporting of some bugfixes for additional testing until we can be certain that they do not have any adverse effects on our LTS releases.

            Pawel Cieszko added a comment - The fix for this issue will be delivered in our next feature release (8.21) and backported to Jira 8.13.x LTS and 8.20.x LTS after several weeks of testing and monitoring the results. This is because we take the reliability and stability of our LTS releases seriously; therefore, we purposefully delay the backporting of some bugfixes for additional testing until we can be certain that they do not have any adverse effects on our LTS releases.

            IT Client added a comment -

            This continues to affect v 8.12.3

            IT Client added a comment - This continues to affect v 8.12.3

            Matt Doar added a comment -

            >32K comments on one issue, yes? That message is pretty cryptic, you're right. This has been a concern for me as we have a fair number of script-generated comments on some issues, up to 1K. We're on MySQL but I still suspect there is an effective limit on the number of comments on an issue, we just don't know it yet

            Matt Doar added a comment - >32K comments on one issue, yes? That message is pretty cryptic, you're right. This has been a concern for me as we have a fair number of script-generated comments on some issues, up to 1K. We're on MySQL but I still suspect there is an effective limit on the number of comments on an issue, we just don't know it yet

            Likewise, one cannot delete a project with >32k comments using Postgres. The Postgres (RDS, if that matters) error is a bit cryptic: "Tried to send an out-of-range integer as a 2-byte value: <id>".

            [c.a.jira.project.DefaultProjectManager] Exception removing issues
            com.querydsl.core.QueryException: Caught PSQLException for delete from public.jiraaction
            where jiraaction.id in (?, ?, ?, ?, ? ........ lots of ?'s)
            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:411)
             at com.atlassian.jira.database.DbConnectionManagerImpl.execute(DbConnectionManagerImpl.java:73)
            ....
            Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
             at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:336)
            ....
            at com.querydsl.sql.dml.SQLDeleteClause.execute(SQLDeleteClause.java:208)
             ... 294 more
            Caused by: java.io.IOException: Tried to send an out-of-range integer as a 2-byte value: 101091
             at org.postgresql.core.PGStream.sendInteger2(PGStream.java:252)
             at org.postgresql.core.v3.QueryExecutorImpl.sendParse(QueryExecutorImpl.java:1470)
             at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1793)
             at org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:1356)
             at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:301)
             

             

            Jeff Turner added a comment - Likewise, one cannot delete a project with >32k comments using Postgres. The Postgres (RDS, if that matters) error is a bit cryptic: "Tried to send an out-of-range integer as a 2-byte value: <id>". [c.a.jira.project.DefaultProjectManager] Exception removing issues com.querydsl.core.QueryException: Caught PSQLException for delete from public .jiraaction where jiraaction.id in (?, ?, ?, ?, ? ........ lots of ?'s) 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:411) at com.atlassian.jira.database.DbConnectionManagerImpl.execute(DbConnectionManagerImpl.java:73) .... Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:336) .... at com.querydsl.sql.dml.SQLDeleteClause.execute(SQLDeleteClause.java:208) ... 294 more Caused by: java.io.IOException: Tried to send an out-of-range integer as a 2- byte value: 101091 at org.postgresql.core.PGStream.sendInteger2(PGStream.java:252) at org.postgresql.core.v3.QueryExecutorImpl.sendParse(QueryExecutorImpl.java:1470) at org.postgresql.core.v3.QueryExecutorImpl.sendOneQuery(QueryExecutorImpl.java:1793) at org.postgresql.core.v3.QueryExecutorImpl.sendQuery(QueryExecutorImpl.java:1356) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:301)    

              Unassigned Unassigned
              45bceedf3ee5 gkunkel1965
              Affected customers:
              16 This affects my team
              Watchers:
              17 Start watching this issue

                Created:
                Updated:
                Resolved: