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

Soap deleteProject call may try to delete an issue more than one time causing it to fail with an Exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 4.0, 4.0.1, 4.0.2, 4.1, 4.1.1
    • 3.10, 3.10.1, 3.10.2, 3.11, 3.12, 3.12.1, 3.12.2, 3.12.3, 3.13, 3.13.1, 3.13.2, 3.13.3, 3.13.4, 3.13.5
    • None

    Description

      A deleteProject SOAP call may try to delete an issue more than one time causing it to fail with an Exception.

      The SOAP deleteProject call gets all issues for the given project through the OfbizDelegator, and then calls on a deleteIssue back-end action which deletes the Issue and its sub-tasks amongst other things.

      Now, if a parent issue is placed before any of its sub-tasks in the list gotten by the OfBizDelegator, the deleteProject call will try to delete the subtask(s) twice.

      The first time implicitly by calling the deleteIssue back-end action on the parent (which will delete the sub-tasks associated with this parent issue), and the second time by trying to delete the sub-task explicitly because it is in the list of issues to be deleted, but this will fail because that sub-task has already been deleted.

      The failure will be in lines 446-447 when it tries to verify permissions on the Project this issue belongs to and the project will be null because the issue is null too (it doesn't exist anymore). Therefore, the if on line 447 will become true (project == null), and we will get a RemotePermissionException saying "The project specified does not exist or you don't have permission to delete issues in it."

      The stack trace will look like:

      Exception in thread "main" AxisFault
      faultCode:

      {http://schemas.xmlsoap.org/soap/envelope/}

      Server.userException
      faultSubcode:
      faultString: com.atlassian.jira.rpc.exception.RemoteException: Error removing project: TEST-PROJECT-KEYCaused by com.atlassian.jira.rpc.exception.RemoteException: Error removing issues: com.atlassian.jira.rpc.exception.RemotePermissionException: This issue does not exist or you don't have permission to view it.Caused by com.atlassian.jira.rpc.exception.RemotePermissionException: This issue does not exist or you don't have permission to view it.
      at com.atlassian.jira.rpc.soap.service.IssueServiceImpl.retrieveIssue(IssueServiceImpl.java:889)
      at com.atlassian.jira.rpc.soap.service.IssueServiceImpl.getIssue(IssueServiceImpl.java:150)
      at com.atlassian.jira.rpc.soap.service.IssueServiceImpl.deleteIssue(IssueServiceImpl.java:446)
      at com.atlassian.jira.rpc.soap.service.ProjectServiceImpl.deleteProject(ProjectServiceImpl.java:490)
      at com.atlassian.jira.rpc.soap.JiraSoapServiceImpl.deleteProject(JiraSoapServiceImpl.java:405)

      Attachments

        Activity

          People

            ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
            ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: