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

Avatar Service should handle more gracefully non-existing / corrupt user entries

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Given data where there are user entries with no associated application user (There's an entry in cwd_users without a matching key in app_users then JIRA will fail to display the edit issue page amongst others because of the faulty data.

      You can determine whether the database in this state by running:

      SELECT * FROM cwd_user WHERE lower_user_name NOT IN (SELECT lower_user_name FROM app_user);
      

      This ultimately caused by the code in:

           @Override
           public URI getAvatarURL(User remoteUser, String username, Avatar.Size size) throws AvatarsDisabledException
           {
               return getAvatarURLImpl(fromStaleUser(remoteUser), false, userManager.getUserByName(username), size);
           }
      

      The exception comes from the call to userManager.getUserByName(username) because the username has an entry in cwd_users without a matching key in app_users.

      The call to userManager.getUserByName should probably be userManager.getUserByNameEvenWhenUnknown or handle the exception, just as fromStaleUser does, so that JIRA can continue to work.

      We should omit the user from places like Assignees.makeAssigneeOptions and userbrowser.jsp when they are in this invalid state.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: