Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.20.10
-
None
-
8.2
-
2
-
Severity 2 - Major
-
0
-
Description
Issue Summary
Due to JRASERVER-71824 if there are stale temporary attachment entries in the DB table tempattachmentsmonitor, Jira creates attachments with "filename*-n*.ext" postfix.
This is reproducible on Data Center: yes
Steps to Reproduce
- Attempt to attach a "large" attachment with a filename that's unique for example "unique-name.pdf" and cancel the upload before the attachment can finish
- Attempt to attach the same file again. (It doesn't matter if you attach the file to the same issue or a different)
Expected Results
Jira attaches the "unique-name.pdf" file with the same name (because there's no "real" attachment with that name anywhere)
Actual Results
Jira will attach the file by renaming it to "unique-name-1.pdf"
Workaround
The reason for this bug is there is/are stale temp attachments both in the filesystem and in the database.
- Identify the stale temporary attachments from the DB:
SELECT * FROM tempattachmentsmonitor WHERE file_name LIKE '%unique-name%';
-
- The expected output would show you one or more temp attachments with the same filename.extension or filename-n.extension - Note the temporary_attachment_id column values
- On each jira nodes' local home you'll find these files with the name temporary_attachment_id in <JIRA-HOME>/caches/tmp_attachments
- delete those files matching the temporary_attachment_id from the SQL statement output from each node in Jira Datacenter
- Now DELETE the entries from the DB
DELETE FROM tempattachmentsmonitor where temporary_attachment_id = 'tempxxxxxxxx';
After deleting the temp attachment entries from the DB - the cache will be loaded again and now when you attach the file with the same name it will not rename it unexpectedly.
Additional Info:
This is not a 100% perfect portrayal of the process. This is intended to shed some light on how this works and where it breaks:
Attachments
Issue Links
- is related to
-
JRASERVER-71824 Temporary attachments not clearing automatically (tmp_attachments)
- Gathering Impact
- mentioned in
-
Page Loading...