com.atlassian.jira.issue.attachment.AttachmentReadException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h3. Summary After attaching *certain* png images to an issue, the issue will no longer be accessible. The page will just load continuously with {{Java Heap Space}} being thrown in the logs h3. Environment * JIRA 6.4.x * Java7 h3. Steps to Reproduce # Install JIRA 6.4.x while using Java7 # Create a project with several issues # Attempt to attach the affected image to an issue #* After attaching an image to a JIRA issue, the image doesn't seem to be successfully attached. It will just be stuck in the following screenshot !stuck.png|thumbnail! # Click *Cancel* or refresh the page h3. Expected Results # The image is attached without any problems # Refreshing the page will load the issue as per normal h3. Actual Results # Image is attached to the issue but a thumbnail will fail to be generates The below exception is thrown in the atlassian-jira.log file: {noformat}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{noformat} # When trying to view the issue again, the page will just load continuously. The following will be thrown in catalina.out {noformat}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{noformat} h3. Notes # Seems to be related to Java version #* After updating Java to version 8, the issue can be viewed but the thumbnail is still not generated # Problem does *not* happen with JIRA 6.3.15 (Java7) # Since JIRA 6.4 supports both Java 7 & 8, JIRA shouldn't be affected by this when Java 7 is used h3.Workaround # Manually generate the thumbnail for this image (instructions found [here|https://confluence.atlassian.com/display/JIRAKB/Unable+to+View+Issue+in+JIRA+after+Attaching+a+PNG+File]); OR # Upgrade your JAVA version to 1.8.0_05 and above
    via by Woo Yit Wei [Atlassian],
  • h3. Summary After attaching *certain* png images to an issue, the issue will no longer be accessible. The page will just load continuously with {{Java Heap Space}} being thrown in the logs h3. Environment * JIRA 6.4.x * Java7 h3. Steps to Reproduce # Install JIRA 6.4.x while using Java7 # Create a project with several issues # Attempt to attach the affected image to an issue #* After attaching an image to a JIRA issue, the image doesn't seem to be successfully attached. It will just be stuck in the following screenshot !stuck.png|thumbnail! # Click *Cancel* or refresh the page h3. Expected Results # The image is attached without any problems # Refreshing the page will load the issue as per normal h3. Actual Results # Image is attached to the issue but a thumbnail will fail to be generates The below exception is thrown in the atlassian-jira.log file: {noformat}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{noformat} # When trying to view the issue again, the page will just load continuously. The following will be thrown in catalina.out {noformat}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{noformat} h3. Notes # Seems to be related to Java version #* After updating Java to version 8, the issue can be viewed but the thumbnail is still not generated # Problem does *not* happen with JIRA 6.3.15 (Java7) # Since JIRA 6.4 supports both Java 7 & 8, JIRA shouldn't be affected by this when Java 7 is used h3.Workaround # Manually generate the thumbnail for this image (instructions found [here|https://confluence.atlassian.com/display/JIRAKB/Unable+to+View+Issue+in+JIRA+after+Attaching+a+PNG+File]); OR # Upgrade your JAVA version to 1.8.0_05 and above
    via by Woo Yit Wei [Atlassian],
  • h4. Summary: *How mail handler normally works:* # detect the email in the inbox # create issue # if it detects attachment, it will try to add the attachment to the issue # once the attachment was successfully added, delete the email from inbox *How it works here (happens occasionally):* When the attachment was not added successfully, the same email stays in the inbox. This cause the mail handler to re-process the email and re-create an issue again out of it h4. Steps to reproduce: This is not reproducible. h4. Error causing the email not being deleted (failed to add the attachment): {code} 2014-12-11 19:58:57,489 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Checking if attachment should be added to issue: 2014-12-11 19:58:57,489 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Content-Type: image/png; name="XYXY.png" 2014-12-11 19:58:57,490 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Content-Disposition: attachment 2014-12-11 19:58:57,491 QuartzScheduler_Worker-3 ERROR ServiceRunner XX.YYYY [atlassian.mail.incoming.mailfetcherservice] XX.YYYY[XYXYX]: Exception: null java.lang.NegativeArraySizeException at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(Unknown Source) at com.atlassian.jira.plugins.mail.handlers.GeneratedAttachmentRecogniser.containsJiraMetadata(GeneratedAttachmentRecogniser.java:64) at com.atlassian.jira.plugins.mail.handlers.GeneratedAttachmentRecogniser.<init>(GeneratedAttachmentRecogniser.java:32) at {code} h4. Suggestion If deleting the unsuccessfully processed email is not an option (perhaps for integrity reason), then maybe mail handler could mark it as *read* and notify the reporter to resend an email for creating issue (while the read email will not be processed anymore).
    via by Aqqiela Zuhra [Atlassian],
  • h4. Summary: *How mail handler normally works:* # detect the email in the inbox # create issue # if it detects attachment, it will try to add the attachment to the issue # once the attachment was successfully added, delete the email from inbox *How it works here (happens occasionally):* When the attachment was not added successfully, the same email stays in the inbox. This cause the mail handler to re-process the email and re-create an issue again out of it h4. Steps to reproduce: This is not reproducible. h4. Error causing the email not being deleted (failed to add the attachment): {code} 2014-12-11 19:58:57,489 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Checking if attachment should be added to issue: 2014-12-11 19:58:57,489 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Content-Type: image/png; name="XYXY.png" 2014-12-11 19:58:57,490 QuartzScheduler_Worker-3 DEBUG ServiceRunner XX.YYYY [mail.incoming.CreateOrCommentHandler.3] Content-Disposition: attachment 2014-12-11 19:58:57,491 QuartzScheduler_Worker-3 ERROR ServiceRunner XX.YYYY [atlassian.mail.incoming.mailfetcherservice] XX.YYYY[XYXYX]: Exception: null java.lang.NegativeArraySizeException at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(Unknown Source) at com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(Unknown Source) at com.atlassian.jira.plugins.mail.handlers.GeneratedAttachmentRecogniser.containsJiraMetadata(GeneratedAttachmentRecogniser.java:64) at com.atlassian.jira.plugins.mail.handlers.GeneratedAttachmentRecogniser.<init>(GeneratedAttachmentRecogniser.java:32) at {code} h4. Suggestion If deleting the unsuccessfully processed email is not an option (perhaps for integrity reason), then maybe mail handler could mark it as *read* and notify the reporter to resend an email for creating issue (while the read email will not be processed anymore).
    via by Aqqiela Zuhra,
    • 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)
    No Bugmate found.