Unable to View Issue in JIRA after Attaching a PNG File
Symptoms
Unable to view the issue after attaching PNG file(s) to an issue in JIRA. Loading of the page takes a very long.
After attaching an image to a JIRA issue, the image doesn't seem to be successfully attached.
If you click on Cancel or refresh the page, you will not be able to view the issue any longer. It just keeps trying to load but remains a blank page
Following appears in the atlassian-jira.log
:
2015-07-22 15:33:55,179 file-attachment-store:thread-2 ERROR admin 933x119x2 1t0ctls 0:0:0:0:0:0:0:1 /plugins/servlet/streams [core.util.thumbnail.Thumber] Unable to create thumbnail image for id 11817
javax.imageio.IIOException: Error reading PNG metadata
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:769)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231)
at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291)
at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178)
at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62)
at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException
at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353)
at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:361)
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:746)
... 17 more
2015-07-22 15:33:55,205 http-bio-8080-exec-10 WARN admin 933x127x2 1t0ctls 0:0:0:0:0:0:0:1 /browse/USIM-103 [jira.issue.thumbnail.DefaultThumbnailManager] Error writing to thumbnail file: C:\Program Files\Atlassian\Application Data\JIRA6.4.4\data\attachments\USIM\USIM-103\thumbs\_thumb_11816.png7671839753314540877.tmp
com.atlassian.jira.issue.attachment.AttachmentReadException: java.lang.NegativeArraySizeException
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:182)
at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62)
at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NegativeArraySizeException
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at com.atlassian.core.util.thumbnail.Thumber.scaleIm age(Thumber.java:231)
at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178)
... 5 more
Following appears in the xxx-stderr.yyyy-mm-dd.log or catalina.out
Exception in thread "file-attachment-store:thread-6" java.lang.OutOfMemoryError: Java heap space
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:745)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1229)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1577)
at com.atlassian.core.util.thumbnail.Thumber.scaleImage(Thumber.java:231)
at com.atlassian.core.util.thumbnail.Thumber.createThumbnail(Thumber.java:291)
at com.atlassian.core.util.thumbnail.Thumber.retrieveOrCreateThumbNail(Thumber.java:270)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:252)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager$3.withInputStream(DefaultThumbnailManager.java:248)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:874)
at com.atlassian.jira.issue.managers.DefaultAttachmentManager$8.get(DefaultAttachmentManager.java:868)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:145)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.get(DefaultFileSystemAttachmentStore.java:141)
at com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:178)
at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62)
at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "file-attachment-store:thread-7" java.lang.OutOfMemoryError: Java heap space
Exception in thread "file-attachment-store:thread-8" java.lang.OutOfMemoryError: Java heap space
Exception in thread "file-attachment-store:thread-10" java.lang.OutOfMemoryError: Java heap space
Exception in thread "file-attachment-store:thread-11" java.lang.OutOfMemoryError: Java heap space
Exception in thread "file-attachment-store:thread-12" java.lang.OutOfMemoryError: Java heap space
Exception in thread "file-attachment-store:thread-13" java.lang.OutOfMemoryError: Java heap space
Diagnosis
Seems to be affecting JIRA 6.4.x
Cause
Due to unknown reason, the JAVA7 is causing this problem.
This is currently being tracked in
-
JRA-44782Getting issue details...
STATUS
Workaround
Manually generate a thumbnail for this image. Assume the affected issue key is TEST-5
- Navigate to <JIRA Home>/data/attachment/TEST
- Open the directory of another working issue with a thumbnail (eg. <JIRA Home>/data/attachment/TEST/TEST-3/thumbs)
- Copy this thumbnail to the *thumbs* directory of the affected issues: <JIRA Home>/data/attachment/TEST/TEST-5/thumbs
- Rename this newly copied thumbnail according to name of the file itself found in <JIRA Home>/data/attachment/TEST/TEST-5
If the "corrupted" image is <JIRA Home>/data/attachment/TEST/TEST-5/10403, the thumbnail should be <JIRA Home>/data/attachment/TEST/TEST-5/thumbs/_thumb_10403.png
Note that if you perform it this way, the thumbnail will be of the copied image, and not of the correct image. If you want the thumbnail to be of the same image, you can try the following
- Open the problematic file in an image editor (eg. GIMP, https://pixlr.com/editor/, etc)
- Save the file as PNG
- Attach this newly saved file to a JIRA issue
- Copy the thumbnail of this issue following the steps above
For JIRA 6.4, upgrading JAVA to version 1.8 will allow JIRA to load the page but the thumbnail could be broken. User can choose to disable thumbnail if they would like to hide the broken thumbnail.
Resolution
Only applies to JIRA 6.3+
- Upgrade your JAVA version to 1.8.0_05+
Note: Please try this on your staging/testing environment before applying the changes to production instance.