How to identify owner of user avatar files in <JiraHome>/data/avatars directory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Avatars are custom pictures uploaded to Jira for a specific entity (eg. user, project, issue types, etc). Users can upload custom avatars as per the following documentation: Managing your user profile - Changing your avatar. This article explains how an admin can identify owners of user avatar files in the <JiraHome>/data/avatars directory, and also how to safely remove them.

Environment

Any version of Jira

Solution

The /data/avatars directory store several different types of avatars. Below lists some of the types of avatars it stores

  • Issue type avatars

  • Project avatars

  • User avatars

Each single avatar file uploaded to Jira will have multiple files of different sizes within this directory. Here is an example of all the files stored in the directory for a single user avatar uploaded in Jira

1 2 3 4 5 6 7 8 9 10 11 12 13 10647_large@3x_profilePicturejrvtg.png 10647_medium_profilePicturejrvtg.png 10647_profilePicturejrvtg.png 10647_small@3x_profilePicturejrvtg.png 10647_small_profilePicturejrvtg.png 10647_xlarge_profilePicturejrvtg.png 10647_xsmall_profilePicturejrvtg.png 10647_xxlarge@2x_profilePicturejrvtg.png 10647_xxlarge@3x_profilePicturejrvtg.png 10647_xxlarge_profilePicturejrvtg.png 10647_xxxlarge@2x_profilePicturejrvtg.png 10647_xxxlarge@3x_profilePicturejrvtg.png 10647_xxxlarge_profilePicturejrvtg.png

Apart from being stored in this directory, records of these avatars are also stored in the avatar table in the database. Below is the record in the database which corresponds to the files above

1 2 3 id | filename | contenttype | avatartype | owner | systemavatar -------+------------------------------------------+-------------+------------+---------------+-------------- 10647 | profilePicturejrvtg.png | image/png | user | JIRAUSER10000 | 0

As you can see, the ID of the avatar in the database is prepended to the name of the files in the directory.

If the avatars directory has grown to a very large size, it's most likely due to excessive user avatars. If you attempt to manually remove the files or the DB records individually, you will be left with orphaned records/files which may cause unwanted behaviours within Jira. Instead, you can perform the following.

The below database queries will help you identify users with the highest number of uploaded custom avatars

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 -- Users with highest number of avatars SELECT DISTINCT(A.OWNER), COUNT(A.OWNER), AU.LOWER_USER_NAME, CU.LOWER_EMAIL_ADDRESS FROM AVATAR A LEFT JOIN APP_USER AU ON A.OWNER = AU.USER_KEY LEFT JOIN CWD_USER CU ON AU.LOWER_USER_NAME = CU.LOWER_USER_NAME WHERE SYSTEMAVATAR = 0 AND AVATARTYPE = 'user' GROUP BY A.AVATARTYPE, A.OWNER, AU.LOWER_USER_NAME, CU.LOWER_EMAIL_ADDRESS ORDER BY COUNT(A.OWNER) DESC; -- Deleted users with highest number of avatars SELECT DISTINCT(A.OWNER), COUNT(A.OWNER), AU.LOWER_USER_NAME FROM AVATAR A LEFT JOIN APP_USER AU ON A.OWNER = AU.USER_KEY WHERE SYSTEMAVATAR = 0AND AVATARTYPE = 'user' AND AU.LOWER_USER_NAME not in (SELECT LOWER_USER_NAME FROM CWD_USER) GROUP BY A.AVATARTYPE, A.OWNER, AU.LOWER_USER_NAME ORDER BY COUNT(A.OWNER) DESC;

ℹ️ Queries written for PostgreSQL. You may have to re-write them for your specific DB.

With this information, you can inform the top users to remove some of the avatars to free up some disk space. If you have admin permissions in Jira, you can also remove these avatars on your own by running the below cURL command

1 curl -u <username>:<password> -X DELETE "<baseURL>/rest/api/latest/user/avatar/<id>"
  • Replace <username> and <password> with credentials of your admin user. Replace <baseURL> with the URL of your instance

  • Replace <id> with the ID of the avatar you want to delete

For example:

1 curl -u admin:password -X DELETE "http://localhost:8080/jira/rest/api/latest/user/avatar/10607"

Running the above curl command will safely remove the avatar from the directory and its corresponding DB record.

You can use any alternative API client to perform the request and achieve the same results (eg. https://www.postman.com/).

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.