User's avatar picture is broken if its previous username is used by another user

XMLWordPrintable

    • 7
    • 25
    • Severity 3 - Minor
    • 1

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

      Summary

      In JIRA, when an user renames a user A and creates a second user B with the previous username, the user A's avatar breaks.

      Steps to Reproduce

      Please, to reproduce, follow this instructions exactly as they are, because we found out that small changes prevent us from replicating it. For example, redoing it with the same user (after deleting users from a previous test) doesn’t reproduce this bug.

      1. Have a clean JIRA instance with default avatar configuration
      2. Create a user (A) with the following data:
        • Username: user1
        • Email: user1@test.com
        • Name: user1
      3. Rename user A this way (the email probably doesn’t play a role here, but some instances use the email to set the username, so it may be required to set the username):
        • Username: user2
        • Email: user2@test.com
        • Name: user2
      4. Create another user (user B) with same username as A had:
        • Username: user1
        • Email: user1@test.com
        • Name: user1
      5. Log in as user A (currently user2)
      6. Set a picture as the user’s avatar
        • This error doesn’t happen with the avatars provided by JIRA, you must create an image and set as avatar to reproduce

      Expected Results

      The avatar is working correctly.

      Actual Results

      The avatar image is broken, both in Cloud and in Server.

      In the user’s profile, we can see these errors in the browser console (Chrome):

      https://instance.atlassian.net/secure/useravatar?ownerId=user1&avatarId=11504 Failed to load resource: net::ERR_TOO_MANY_REDIRECTS
      

      And:

      http://localhost:8080/plugins/servlet/gadgets/ifr?container=atlassian&mid=1…2Fgadgets%2Factivitystream-gadget.xml&libs=auth-refresh#rpctoken=499011633 Failed to load resource: the server responded with a status of 410 (Gone)
      

      Copying the image link and trying to open it shows an error page with ERR_TOO_MANY_REDIRECTS. The image link is the one in the first error mentioned above (for example, 'https://instance.atlassian.net/secure/useravatar?ownerId=user1&avatarId=11504')

      This illustrates:

      Workaround

      Partial Workaround
      If possible, remove user B to fix user A

      Workaround 2
      Change user B's username to something else

      Important: User B is not the affected user (that's user A, check 'Steps to Reproduce'). User B is a user whose username is the same as user A's original username.

      If you don't know user A's original username to find user B, you can use this search in the database:

      select user_key from app_user where id = (select id from cwd_user where user_name = 'user2');
      

      Just replace 'user2' by user A's current username and you'll find the original one, used by the other user.

            Assignee:
            Daniel Rauf
            Reporter:
            Jaime S
            Votes:
            3 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: