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

Deleting an attachment does not remove its thumbnail from the filesystem

      Summary

      When an attachment is removed from an issue, the internal <JIRA_HOME>/data/attachments/ folder does not delete the created thumbnail.

      Steps to Reproduce

      1. Create an issue
      2. Attach an image to it (More > Attach Files or Attach Screenshot)
      3. Delete the attachment (click the trash icon at the thumbnail)

      Expected Results

      All the content from that attachment is removed from <JIRA_HOME>/data/attachments/<ISSUE_KEY> folder

      Actual Results

      The image thumbnail remains in the <JIRA_HOME>/data/attachments/<ISSUE_KEY>/thumb folder

      Workaround

      Manually remove the <JIRA_HOME>/data/attachments/<ISSUE_KEY>/thumb/thumb<XYZ>.png thumbnail file if there is no <XYZ> file at <JIRA_HOME>/data/attachments/<ISSUE_KEY>/ folder.

          Form Name

            [JRASERVER-45302] Deleting an attachment does not remove its thumbnail from the filesystem

            Was this fix really backported in the 8.2.2+ release?
            We've updated to 8.2.4 and the thumbnails are still left abandoned on the disk

            find JIRA-217
            > JIRA-217
            > JIRA-217/thumbs
            > JIRA-217/thumbs/_thumb_58144.png
            > JIRA-217/thumbs/_thumb_58143.png
            > JIRA-217/thumbs/_thumb_58145.png
            > JIRA-217/58143
            > JIRA-217/58144
            > JIRA-217/58145
            
            curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58143
            curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58144
            curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58145
            
            find JIRA-217
            > JIRA-217
            > JIRA-217/thumbs
            > JIRA-217/thumbs/_thumb_58144.png
            > JIRA-217/thumbs/_thumb_58143.png
            > JIRA-217/thumbs/_thumb_58145.png
            
            

            Philippe Busque added a comment - Was this fix really backported in the 8.2.2+ release? We've updated to 8.2.4 and the thumbnails are still left abandoned on the disk find JIRA-217 > JIRA-217 > JIRA-217/thumbs > JIRA-217/thumbs/_thumb_58144.png > JIRA-217/thumbs/_thumb_58143.png > JIRA-217/thumbs/_thumb_58145.png > JIRA-217/58143 > JIRA-217/58144 > JIRA-217/58145 curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58143 curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58144 curl -X DELETE --netrc https://jira.example.com/rest/api/2/attachment/58145 find JIRA-217 > JIRA-217 > JIRA-217/thumbs > JIRA-217/thumbs/_thumb_58144.png > JIRA-217/thumbs/_thumb_58143.png > JIRA-217/thumbs/_thumb_58145.png

            Daniel Rauf added a comment - - edited

            Starting from versions 8.2.2 and 8.3.0, Jira will delete thumnbails when a user deletes an attachment.

            Daniel Rauf added a comment - - edited Starting from versions 8.2.2 and 8.3.0, Jira will delete thumnbails when a user deletes an attachment.

            Matt Doar added a comment -

            Good point! GDPR ... (cue Jaws theme)

            Matt Doar added a comment - Good point! GDPR ... (cue Jaws theme)

            While this issue is prioritized as low, you are only considering the unnecessary storage space it takes, not that it would be a violation of GDPR if the thumbnail includes Personally Identifiable Information and you had the purpose to remove it.

            Richard Clarinsson added a comment - While this issue is prioritized as low, you are only considering the unnecessary storage space it takes, not that it would be a violation of GDPR if the thumbnail includes Personally Identifiable Information and you had the purpose to remove it.

            Matt Doar added a comment -

            Just came across this again today. 1.4 million attachments, so say 1 million thumbnails in one of 4 filename formats. 10KB each file and you've got 10GB of wasted storage right there. 

            Matt Doar added a comment - Just came across this again today. 1.4 million attachments, so say 1 million thumbnails in one of 4 filename formats. 10KB each file and you've got 10GB of wasted storage right there.  

            Indeed matt.doar / pbusque@mediagrif.com,

            This matches my understanding of the impact of the bug described here. Thanks for your input

            Regards,

            Oswaldo Hernández.
            JIRA Bugmaster.
            [Atlassian].

            Oswaldo Hernandez (Inactive) added a comment - Indeed matt.doar / pbusque@mediagrif.com , This matches my understanding of the impact of the bug described here. Thanks for your input Regards, Oswaldo Hernández. JIRA Bugmaster. [Atlassian] .

            MattS added a comment -

            The impact is lots of little unwanted files that confuse admins and take up unnecessary space. And it's just untidy and annoying and wrong!

            MattS added a comment - The impact is lots of little unwanted files that confuse admins and take up unnecessary space. And it's just untidy and annoying and wrong!

            Hello hernandez.oswaldo,
            I think I could not give you an answer better than pbusque@mediagrif.com did.

            Daniel Santos (Inactive) added a comment - Hello hernandez.oswaldo , I think I could not give you an answer better than pbusque@mediagrif.com did.

            An accumulation of orphaned files over the years

            When moving an issue, the attachments are moved, but not the thumbs, thus leaving an orphaned attachment folder and thumbnail image. This has an impact on issue JRA-19873 as the folder cannot be pruned as it is not empty. And if the issue is deleted, while it delete the attachment folder for the issue, it doesn't delete the left over from the previous move. If the issue was moved n time, there will be n attachments left on the file system.

            Another use case is with people using images signature with their email, which attach said image to the request. Even if they delete the images after the issue has been created, the thumbnails will remains.

            Worse, for system who upgraded from Jira 3.X , this can sometime leave 4 thumbnails: the new one and the one from the legacy format
            /PROJECT-KEY/ISSUE-KEY/ATTACHEMENT-IDthumbATTACHMENT-NAME.png
            Example:
            JIRA/JIRA-1/27954_image002.png
            JIRA/JIRA-1/27954_thumb_image002.png
            JIRA/JIRA-1/27954_thumb_image002.png
            JIRA/JIRA-1/_thumb_27954.png

            Upon deletion, only 1 file (JIRA/JIRA-1/27954_image002.png) out of the 4 created files will be deleted.

            Those file linger in the file system while no longer being used. In big instance of Jira, this can escalate to 10 of thousand of orphaned files

            Philippe Busque added a comment - An accumulation of orphaned files over the years When moving an issue, the attachments are moved, but not the thumbs, thus leaving an orphaned attachment folder and thumbnail image. This has an impact on issue JRA-19873 as the folder cannot be pruned as it is not empty. And if the issue is deleted, while it delete the attachment folder for the issue, it doesn't delete the left over from the previous move. If the issue was moved n time, there will be n attachments left on the file system. Another use case is with people using images signature with their email, which attach said image to the request. Even if they delete the images after the issue has been created, the thumbnails will remains. Worse, for system who upgraded from Jira 3.X , this can sometime leave 4 thumbnails: the new one and the one from the legacy format / PROJECT-KEY / ISSUE-KEY / ATTACHEMENT-ID thumb ATTACHMENT-NAME .png Example: JIRA/JIRA-1/27954_image002.png JIRA/JIRA-1/27954_thumb_image002.png JIRA/JIRA-1/27954_thumb_image002.png JIRA/JIRA-1/_thumb_27954.png Upon deletion, only 1 file (JIRA/JIRA-1/27954_image002.png) out of the 4 created files will be deleted. Those file linger in the file system while no longer being used. In big instance of Jira, this can escalate to 10 of thousand of orphaned files

            Hi dsantos,

            What is the impact to the end user of us not removing the thumbnail image?

            Cheers,
            Os.

            Oswaldo Hernandez (Inactive) added a comment - Hi dsantos , What is the impact to the end user of us not removing the thumbnail image? Cheers, Os.

              drauf Daniel Rauf
              dsantos Daniel Santos (Inactive)
              Affected customers:
              8 This affects my team
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: