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

When creating a new migration plan having stopped a previously plan can cause the new migration to fail

    XMLWordPrintable

Details

    • 3
    • Severity 3 - Minor
    • 1

    Description

      Issue Summary

      When having a migration plan that was stopped or that failed and is in STOPPED status in the database, the next migration plan will try to resume that step/task and fail.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create a plan, progress it a little, and stop it
      2. Create a new plan
      3. Start the new plan, and after a while, it may fail, with an error "Can not make transition from STOPPED to RUNNING"

      Expected Results

      The new migration creates a whole new step and task without trying to resume the one from the old migration and proceed without failures.

      Actual Results

      The below exception is thrown in the Atlassian-Confluence.log file:

      ERROR [pool-39-thread-4] [agent.service.impl.DefaultPlanService] startPlan Fail to start the plan: <planid>
       -- referer: http:/<server>/admin/migration.action | url: /rest/migration/latest/plan/planid/start | traceId: efa38f93aafb50db | userName: sysadmin
      java.lang.IllegalStateException: Can not make transition from STOPPED to RUNNING
      	at com.atlassian.migration.agent.entity.Progress$Copier.checkCanGo(Progress.java:206)
      	at com.atlassian.migration.agent.entity.Progress$Copier.started(Progress.java:146)
      	at com.atlassian.migration.agent.service.stepexecutor.ProgressTracker.started(ProgressTracker.java:126)
      	at com.atlassian.migration.agent.service.execution.PlanExecutionService.allocateStepToNode(PlanExecutionService.java:418)
      	at com.atlassian.migration.agent.service.execution.PlanExecutionService.tryAllocateSteps(PlanExecutionService.java:400)
      	at com.atlassian.migration.agent.service.execution.PlanExecutionService.allocatePendingSteps(PlanExecutionService.java:385)
      	at com.atlassian.migration.agent.service.execution.PlanExecutionService.lambda$runPlan$1(PlanExecutionService.java:212)
      	at com.atlassian.migration.agent.store.jpa.impl.DefaultPluginTransactionTemplate.on(DefaultPluginTransactionTemplate.java:36)
      	at com.atlassian.migration.agent.store.tx.PluginTransactionTemplate.write(PluginTransactionTemplate.java:24)
      	at com.atlassian.migration.agent.service.execution.PlanExecutionService.runPlan(PlanExecutionService.java:206)
      	at com.atlassian.migration.agent.service.impl.DefaultPlanService.startPlan(DefaultPlanService.java:390)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.startPreflightCheckAndPoll(PlanDecoratorService.java:212)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.startPreflightChecksAndPoll(PlanDecoratorService.java:182)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.lambda$verifyAndStart$0(PlanDecoratorService.java:153)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      INFO [pool-39-thread-4] [agent.service.stepexecutor.ProgressTracker] info Cleaning up user mappings for plan <planid>
       -- referer: http://<server>/admin/migration.action | url: /rest/migration/latest/plan/planid/start | traceId: efa38f93aafb50db | userName: sysadmin
      ERROR [pool-39-thread-4] [agent.service.user.UserMappingsFileManager] error Failed to clean up user mappings file. Reason: /efs/application-data/confluence/shared-home/migration/user-mappings/<id>.json
       -- referer: http://<server>/admin/migration.action | url: /rest/migration/latest/plan/planid/start | traceId: efa38f93aafb50db | userName: sysadmin
      java.nio.file.NoSuchFileException: /efs/application-data/confluence/shared-home/migration/user-mappings/<id>.json
      	at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
      	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
      	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
      	at java.base/sun.nio.fs.UnixFileSystemProvider.implDelete(Unknown Source)
      	at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
      	at java.base/java.nio.file.Files.delete(Unknown Source)
      	at com.atlassian.migration.agent.service.user.UserMappingsFileManager.cleanupUserMappingsFile(UserMappingsFileManager.java:65)
      	at com.atlassian.migration.agent.service.stepexecutor.ProgressTracker.cleanupUserMappings(ProgressTracker.java:414)
      	at com.atlassian.migration.agent.service.stepexecutor.ProgressTracker.failPlan(ProgressTracker.java:253)
      	at com.atlassian.migration.agent.service.impl.DefaultPlanService.startPlan(DefaultPlanService.java:396)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.startPreflightCheckAndPoll(PlanDecoratorService.java:212)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.startPreflightChecksAndPoll(PlanDecoratorService.java:182)
      	at com.atlassian.migration.agent.service.impl.PlanDecoratorService.lambda$verifyAndStart$0(PlanDecoratorService.java:153)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      

      Workaround

      The workaround requires an analysis of a case-by-case scenario, please reach out to Atlassian support for further assistance

      Attachments

        Issue Links

          Activity

            People

              atiwari2@atlassian.com Anshuman Tiwari (Inactive)
              ddresch@atlassian.com Dilan Dresch
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: