com.atlassian.studio.host.common.DataSetupException: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855

Atlassian JIRA | Matthew Hunter | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    h3. Summary When there are a significant number of attachments to import it inevitably fails as the iostream closes. The only option is then to import without attachments and support moves the attachments in later. h3. Environment * JIRA Cloud h3. Steps to Reproduce # Perform a JIRA import including a zip file with many attachments (in my case it failed with 3,333 attachments) h3. Expected Results Import completes successfully. h3. Actual Results The import fails with cause: {noformat} Caused by: com.atlassian.jira.issue.attachment.AttachmentWriteException: java.io.IOException: Stream closed {noformat} Full error: {noformat} com.atlassian.studio.host.common.DataSetupException: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855 at com.atlassian.studio.jira.importer.impl.JiraImportFileServiceImpl.importArchive(JiraImportFileServiceImpl.java:260) at com.atlassian.studio.jira.importer.impl.StudioImporterFacade.importArchive(StudioImporterFacade.java:171) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importFileArchives(StudioDataImportAsyncCommand.java:210) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importDataAndFiles(StudioDataImportAsyncCommand.java:175) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:120) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:61) at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:157) at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:133) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855 at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.tryUploadAttachment(SingleAttachmentUploader.java:62) at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.apply(SingleAttachmentUploader.java:51) at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.apply(SingleAttachmentUploader.java:24) at com.google.common.collect.Iterators$8.transform(Iterators.java:799) at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at com.google.common.collect.Iterators.getNext(Iterators.java:865) at com.google.common.collect.Iterators.find(Iterators.java:733) at com.atlassian.studio.jira.importer.impl.upload.stream.UploadAllEntries.visit(UploadAllEntries.java:45) at com.atlassian.studio.jira.importer.impl.upload.stream.UploadAllEntries.visit(UploadAllEntries.java:26) at com.atlassian.studio.jira.importer.impl.archive.ZipArchiveExtractor.visitEntries(ZipArchiveExtractor.java:97) at com.atlassian.studio.jira.importer.impl.upload.stream.StreamArchiveUploader.uploadEntries(StreamArchiveUploader.java:58) at com.atlassian.studio.jira.importer.impl.JiraImportFileServiceImpl.importArchive(JiraImportFileServiceImpl.java:258) ... 13 more Caused by: com.atlassian.jira.issue.attachment.AttachmentWriteException: java.io.IOException: Stream closed at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142) at io.atlassian.blobstore.client.impl.net.Sources$1.read(Sources.java:34) at okio.RealBufferedSink.writeAll(RealBufferedSink.java:96) at io.atlassian.blobstore.client.impl.net.StreamingRequestBody.writeTo(StreamingRequestBody.java:43) at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:760) at com.squareup.okhttp.Call.getResponse(Call.java:274) at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230) at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201) at com.squareup.okhttp.Call.execute(Call.java:81) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl.lambda$doPut$16(RemoteBlobStoreImpl.java:268) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl$$Lambda$1285/33115244.get(Unknown Source) at com.atlassian.fugue.retry.RetrySupplier.get(RetrySupplier.java:93) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl.lambda$retried$20(RemoteBlobStoreImpl.java:364) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl$$Lambda$1286/24824753.get(Unknown Source) at com.atlassian.util.concurrent.Suppliers$CallableAdapter.call(Suppliers.java:119) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$5.apply(BlobStoreAttachmentStore.java:132) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$5.apply(BlobStoreAttachmentStore.java:128) at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) at com.atlassian.fugue.Either$Left.fold(Either.java:545) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$15.apply(BlobStoreAttachmentStore.java:304) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$15.apply(BlobStoreAttachmentStore.java:301) at com.atlassian.util.concurrent.Promises$Of$1.apply(Promises.java:263) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185) at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) ... 3 more {noformat} h3.Notes Similar error when using tar.gz files [JRA-59605|https://jira.atlassian.com/browse/JRA-59605] but with different cause. h3.Workaround Import with just the JIRA XML and request Atlassian Cloud Support (https://support.atlassian.com) migrate the attachments for you.

    Atlassian JIRA | 1 year ago | Matthew Hunter
    com.atlassian.studio.host.common.DataSetupException: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855
  2. 0

    h3. Summary When there are a significant number of attachments to import it inevitably fails as the iostream closes. The only option is then to import without attachments and support moves the attachments in later. h3. Environment * JIRA Cloud h3. Steps to Reproduce # Perform a JIRA import including a zip file with many attachments (in my case it failed with 3,333 attachments) h3. Expected Results Import completes successfully. h3. Actual Results The import fails with cause: {noformat} Caused by: com.atlassian.jira.issue.attachment.AttachmentWriteException: java.io.IOException: Stream closed {noformat} Full error: {noformat} com.atlassian.studio.host.common.DataSetupException: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855 at com.atlassian.studio.jira.importer.impl.JiraImportFileServiceImpl.importArchive(JiraImportFileServiceImpl.java:260) at com.atlassian.studio.jira.importer.impl.StudioImporterFacade.importArchive(StudioImporterFacade.java:171) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importFileArchives(StudioDataImportAsyncCommand.java:210) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.importDataAndFiles(StudioDataImportAsyncCommand.java:175) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:120) at com.atlassian.jira.studio.importer.StudioDataImportAsyncCommand.call(StudioDataImportAsyncCommand.java:61) at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:157) at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:133) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855 at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.tryUploadAttachment(SingleAttachmentUploader.java:62) at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.apply(SingleAttachmentUploader.java:51) at com.atlassian.studio.jira.importer.impl.upload.stream.SingleAttachmentUploader.apply(SingleAttachmentUploader.java:24) at com.google.common.collect.Iterators$8.transform(Iterators.java:799) at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at com.google.common.collect.Iterators.getNext(Iterators.java:865) at com.google.common.collect.Iterators.find(Iterators.java:733) at com.atlassian.studio.jira.importer.impl.upload.stream.UploadAllEntries.visit(UploadAllEntries.java:45) at com.atlassian.studio.jira.importer.impl.upload.stream.UploadAllEntries.visit(UploadAllEntries.java:26) at com.atlassian.studio.jira.importer.impl.archive.ZipArchiveExtractor.visitEntries(ZipArchiveExtractor.java:97) at com.atlassian.studio.jira.importer.impl.upload.stream.StreamArchiveUploader.uploadEntries(StreamArchiveUploader.java:58) at com.atlassian.studio.jira.importer.impl.JiraImportFileServiceImpl.importArchive(JiraImportFileServiceImpl.java:258) ... 13 more Caused by: com.atlassian.jira.issue.attachment.AttachmentWriteException: java.io.IOException: Stream closed at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142) at io.atlassian.blobstore.client.impl.net.Sources$1.read(Sources.java:34) at okio.RealBufferedSink.writeAll(RealBufferedSink.java:96) at io.atlassian.blobstore.client.impl.net.StreamingRequestBody.writeTo(StreamingRequestBody.java:43) at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:760) at com.squareup.okhttp.Call.getResponse(Call.java:274) at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230) at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201) at com.squareup.okhttp.Call.execute(Call.java:81) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl.lambda$doPut$16(RemoteBlobStoreImpl.java:268) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl$$Lambda$1285/33115244.get(Unknown Source) at com.atlassian.fugue.retry.RetrySupplier.get(RetrySupplier.java:93) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl.lambda$retried$20(RemoteBlobStoreImpl.java:364) at io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl$$Lambda$1286/24824753.get(Unknown Source) at com.atlassian.util.concurrent.Suppliers$CallableAdapter.call(Suppliers.java:119) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$5.apply(BlobStoreAttachmentStore.java:132) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$5.apply(BlobStoreAttachmentStore.java:128) at com.google.common.base.Functions$FunctionComposition.apply(Functions.java:216) at com.atlassian.fugue.Either$Left.fold(Either.java:545) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$15.apply(BlobStoreAttachmentStore.java:304) at com.atlassian.jira.issue.attachment.store.BlobStoreAttachmentStore$15.apply(BlobStoreAttachmentStore.java:301) at com.atlassian.util.concurrent.Promises$Of$1.apply(Promises.java:263) at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:185) at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185) at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53) at com.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:62) at com.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:93) ... 3 more {noformat} h3.Notes Similar error when using tar.gz files [JRA-59605|https://jira.atlassian.com/browse/JRA-59605] but with different cause. h3.Workaround Import with just the JIRA XML and request Atlassian Cloud Support (https://support.atlassian.com) migrate the attachments for you.

    Atlassian JIRA | 1 year ago | Matthew Hunter
    com.atlassian.studio.host.common.DataSetupException: com.atlassian.jira.issue.attachment.AttachmentRuntimeException: Could not upload attachment id:14,855 entry name:attachments/KEY/KEY-1504/14855

    Root Cause Analysis

    1. com.atlassian.jira.issue.attachment.AttachmentWriteException

      java.io.IOException: Stream closed

      at java.util.zip.InflaterInputStream.ensureOpen()
    2. Java RT
      InflaterInputStream.read
      1. java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
      2. java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
      2 frames
    3. io.atlassian.blobstore
      Sources$1.read
      1. io.atlassian.blobstore.client.impl.net.Sources$1.read(Sources.java:34)
      1 frame
    4. Okio
      RealBufferedSink.writeAll
      1. okio.RealBufferedSink.writeAll(RealBufferedSink.java:96)
      1 frame
    5. io.atlassian.blobstore
      StreamingRequestBody.writeTo
      1. io.atlassian.blobstore.client.impl.net.StreamingRequestBody.writeTo(StreamingRequestBody.java:43)
      1 frame
    6. OkHttp
      Call.execute
      1. com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:760)
      2. com.squareup.okhttp.Call.getResponse(Call.java:274)
      3. com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:230)
      4. com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:201)
      5. com.squareup.okhttp.Call.execute(Call.java:81)
      5 frames
    7. io.atlassian.blobstore
      RemoteBlobStoreImpl.lambda$doPut$16
      1. io.atlassian.blobstore.client.impl.RemoteBlobStoreImpl.lambda$doPut$16(RemoteBlobStoreImpl.java:268)
      1 frame