In some cases, if an incoming mail used to reply to an existing ticket contains attachments which names match the names of attachments that are already in the ticket, the mail will fail to be processed.
Steps to Reproduce
The exact steps to reproduce are not clear yet as we haven't been able to reproduce it in our environment. However, from what we observed, the issue seems to happen:
- when the existing ticket was created with attachment before an upgrade to JSD 4.8.0 (Jira 8.8.0)
- when the reply to this ticket (containing attachments of same name) was sent after the upgrade to JSD 4.8.0 (Jira 8.8.0)
The email should be processed a new comment should be added to the ticket, along with the attachments.
The email fails to be processed, and the following error will be thrown in the Jira logs:
2020-06-05 11:33:06,311+0300 Caesium-1-3 ERROR XXX [c.a.p.i.util.runner.AuthenticationContextUtilImpl] Unexpected error while running action as user 'XXX'
java.lang.IllegalStateException: Duplicate key com.atlassian.jira.issue.attachment.Attachment@ffffff2a
2020-04-02 23:36:53,401+0200 Caesium-1-2 ERROR firstname.lastname@example.org [c.a.p.i.util.runner.AuthenticationContextUtilImpl] Unexpected error while running action as user 'user'
java.lang.IllegalStateException: Duplicate key image001.png (attempted merging values com.atlassian.jira.issue.attachment.Attachment@ffffff2a and com.atlassian.jira.issue.attachment.Attachment@fffff955)
Remove all the images imageXXX.png directly from the ticket created before the Service Desk upgrade to 4.8.0. By doing this, new emails sent to these tickets that contain the same attachments imageXXX.png should be added successfully.
When replying to an email to add a comment to an existing ticket, make sure that this email does not contain signature image (remove any image with file names such as imageXXX.png.