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

Retrieving issue details using REST API breaks if invalid user is found

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Medium
    • None
    • 4.3.4
    • REST API

    Description

      Steps to reproduce:

      1. Create an issue as user A (TST-1)
      2. Login using user B and make a comment into the issue TST-1 (commenter is user B)
      3. Retrieve the issue details using REST API and the result can be shown correctly. For example:
        cychan@cychan-laptop:~$ curl -u admin:admin http://localhost:8080/rest/api/2.0.alpha1/issue/TST-1
        {"expand":"html","self":"http://localhost:8080/rest/api/2.0.alpha1/issue/TST-1","key":"TST-1","fields":{"summary":{"name":"summary","type":"java.lang.String","value":"test1"},"timetracking":
        ...
        {"name":"components","type":"com.atlassian.jira.bc.project.component.ProjectComponent","value":[]},"comment":{"name":"comment","type":"com.atlassian.jira.issue.fields.CommentSystemField","value":[{"self":"http://localhost:8080/rest/api/2.0.alpha1/comment/10000","author":{"self":"http://localhost:8080/rest/api/2.0.alpha1/user?username=test","name":"test","displayName":"test"},"body":"testing the commenter","updateAuthor":{"self":"http://localhost:8080/rest/api/2.0.alpha1/user?username=test","name":"test","displayName":"test"},"created":"2011-07-21T15:27:40.000+0800","updated":"2011-07-21T15:27:40.000+0800"}]}},"transitions":"http://localhost:8080/rest/api/2.0.alpha1/issue/TST-1/transitions"}cychan@cychan-laptop:~$ 
        
      4. Delete the account of user B (the commenter link in TST-1 will be disappeared)
      5. Refresh the issue detail page of issue TST-1 in Internet Browser and no error message displayed in the log file
      6. Retrieve the issue details using REST API again and hit into error message. For example:
        cychan@cychan-laptop:~$ curl -u admin:admin http://localhost:8080/rest/api/2.0.alpha1/issue/TST-1
        {"errorMessages":["Internal server error"],"errors":{}}cychan@cychan-laptop:~$ 
        
      7. This error message is displayed in the log file:
        2011-07-21 16:10:58,188 http-8080-2 ERROR admin 970x749x1 - 0:0:0:0:0:0:0:1 /rest/api/2.0.alpha1/issue/TST-1 [jira.rest.exception.ExceptionInterceptor] Returning internal server error in response
        java.lang.reflect.InvocationTargetException
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        ...
        Caused by: java.lang.RuntimeException: com.opensymphony.user.EntityNotFoundException: No user 'test' found
        	at com.atlassian.jira.issue.comments.CommentImpl.getAuthorObject(CommentImpl.java:86)
        

      Workaround:
      Re-create the deleted user but remove his membership from all the groups so that it won't count towards the license limit and the user won't be able to login.

      Suggestion:
      The REST API should check if such user was deleted then no need to include them in the retrieved result.

      Attachments

        Issue Links

          Activity

            People

              aswan@atlassian.com Andrew S
              cychan Chai Ying Chan [Atlassian]
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: