Uploaded image for project: 'Migration Platform'
  1. Migration Platform
  2. MIG-231

JCMA may fail to migrate some attachments

XMLWordPrintable

    • 5
    • Major

      Issue Summary

      Some times when migrating projects using JCMA, some attachments may fail to migrate into some issues, this is a random problem and doesn't seem to be caused by specific type of attachment, it's rather a transient issue that can have a myriad of causes disk reliability, available db connection, network, server load, etc. Ideally, JCMA should fail the project migration if some of the attachments do not get migrated.

      Steps to Reproduce

      The problem is intermittent.

      Expected Results

      All attachments are successfully migrated.

      Actual Results

      The migration completes partially, and some issues will be missing attachments.

      The below exception is thrown in the atlassian-jira.log file:

      020-08-01 14:04:49,878-0400 pool-419-thread-5 WARN xxxxxx 659x6686x4 1w4yjib xxxxxx /rest/plugins/1.0/installed-marketplace [c.a.j.m.workers.attachments.AttachmentProcessor] xxxxxxxxxx-attachmentsUpload#xxxxxx$xxxxxxx: error in attachments upload task for project key xxxxxxxx
      com.atlassian.jira.migration.workers.attachments.AttachmentUploadException: com.atlassian.jira.issue.attachment.AttachmentReadException: com.atlassian.jira.migration.mediaclient.MediaClientErrorException: request to Media failed
      com.atlassian.jira.migration.workers.attachments.AttachmentsUploader.uploadAttachments(AttachmentsUploader.kt:89)
      com.atlassian.jira.migration.workers.attachments.AttachmentProcessor.process(AttachmentsWorker.kt:97)
      com.atlassian.jira.migration.workers.attachments.AttachmentsWorker.process(AttachmentsWorker.kt:52)
      	at com.atlassian.jira.migration.tracking.polling.Poller.dispatchTask(Poller.kt:116)
      com.atlassian.jira.migration.tracking.polling.Poller.pollForTaskAndDispatch(Poller.kt:111)
      com.atlassian.jira.migration.tracking.polling.Poller.pollForTaskAndDispatchNoThrow(Poller.kt:65)
      	at com.atlassian.jira.migration.tracking.polling.Poller.doPoll(Poller.kt:50)
      com.atlassian.jira.migration.tracking.polling.AbstractPoller.execute(AbstractPoller.kt:62)
      com.atlassian.jira.migration.tracking.polling.AbstractPoller.access$execute(AbstractPoller.kt:16)
      com.atlassian.jira.migration.tracking.polling.AbstractPoller$startPolling$1.invoke(AbstractPoller.kt:35)
      com.atlassian.jira.migration.tracking.polling.AbstractPoller$startPolling$1.invoke(AbstractPoller.kt:16)
      com.atlassian.jira.migration.tracking.utils.ThreadUtils.safeExecutePeriodicallyUntilStopped(ThreadUtils.kt:43)
      com.atlassian.jira.migration.tracking.polling.AbstractPoller.startPolling(AbstractPoller.kt:34)
      com.atlassian.jira.migration.tracking.MigrationTracker$addAndStartWorkPoller$1$1.run(MigrationTracker.kt:77)
      	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:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.atlassian.jira.issue.attachment.AttachmentReadException: com.atlassian.jira.issue.attachment.AttachmentReadException: com.atlassian.jira.migration.mediaclient.MediaClientErrorException: request to Media failed
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
      com.atlassian.jira.migration.workers.attachments.AttachmentsUploader.uploadAttachments(AttachmentsUploader.kt:74)
      Caused by: com.atlassian.jira.issue.attachment.AttachmentReadException: com.atlassian.jira.migration.mediaclient.MediaClientErrorException: request to Media failed
      com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:152)
      io.atlassian.util.concurrent.Executors$DefaultSubmitter$CallableRunner.run(Executors.java:85)
      	at io.atlassian.util.concurrent.LimitedExecutor$Runner.run(LimitedExecutor.java:94)
      Caused by: com.atlassian.jira.migration.mediaclient.MediaClientErrorException: request to Media failed
      com.atlassian.jira.migration.mediaclient.MediaClient.updateUpload(MediaClient.kt:128)
      com.atlassian.jira.migration.workers.attachments.AttachmentsUploader$uploadAttachmentContent$1.withInputStream(AttachmentsUploader.kt:169)
      com.atlassian.jira.migration.workers.attachments.AttachmentsUploader$uploadAttachmentContent$1.withInputStream(AttachmentsUploader.kt:31)
      com.atlassian.jira.issue.managers.DefaultAttachmentManager$7.apply(DefaultAttachmentManager.java:731)
      com.atlassian.jira.issue.managers.DefaultAttachmentManager$7.apply(DefaultAttachmentManager.java:727)
      com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.apply(DefaultFileSystemAttachmentStore.java:127)
      com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$2.apply(DefaultFileSystemAttachmentStore.java:124)
      com.atlassian.jira.issue.attachment.store.DefaultFileSystemAttachmentStore$3.call(DefaultFileSystemAttachmentStore.java:150)
      Caused by: com.atlassian.jira.migration.httpclient.exceptions.UnexpectedStatusCodeException: Received an unexpected status code; expected [200], but received 409: {"error":{"code":"InvalidStateError","title":"Conflict: provided offset 0 must be equal to current number of chunks","href":"https://api.media.atlassian.com#InvalidStateError"}}
      com.atlassian.jira.migration.httpclient.exceptions.ExceptionsKt.unexpectedStatusCode(Exceptions.kt:7)
      com.atlassian.jira.migration.httpclient.MigrationPluginHttpClient.checkExpectedResponseCode(MigrationPluginHttpClient.kt:121)
      com.atlassian.jira.migration.httpclient.MigrationPluginHttpClient.execute(MigrationPluginHttpClient.kt:65)
      	at com.atlassian.jira.migration.mediaclient.MediaClient.execute(MediaClient.kt:175)
      

      Workaround

      Delete the projects and remigrate the affected projects.

              dweerasinghe@atlassian.com Dilan Weerasinghe
              dbrito Daniel Brito [Atlassian]
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: