Plan list view not loading in JCMA

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High
    • None
    • Affects Version/s: JCMA - 1.9.17, JCMA - 1.10.13
    • None
    • 19
    • Severity 3 - Minor
    • 56

      Issue Summary

      Viewing plan list fails like below, this is caused by being unauthenticated to your cloud sites that you have migrated to.

      Steps to Reproduce

      1. Create a plan with app migrations and run it
      2. Wait to be unauthenticated from cloud site and app migration remains in progress
      3. View plans on `/jira/secure/migration-app-action.jspa#/monitor`

      Expected Results

      Plans still load despite partial failure to retrieve app progress due to being unauthenticated for cloud site

      Actual Results

      Plans will fail to load caused by the following stacktrace

       

      /rest/migration/latest/plan [c.a.j.m.plan.rest.PlanRepositoryExceptionMapper] Error occurred when working with plans com.atlassian.jira.migration.plan.rest.FetchPlanListException: Error occurred when trying to fetch plan list Caused by: com.atlassian.jira.migration.httpclient.exceptions.UnexpectedStatusCodeException: Received an unexpected status code; expected [200], but received 401: {"code":401,"message":"Unauthorized"} at com.atlassian.jira.migration.httpclient.exceptions.ExceptionsKt.unexpectedStatusCode(Exceptions.kt:7) at com.atlassian.jira.migration.httpclient.AbstractPluginHttpClient.checkExpectedResponseCode(AbstractPluginHttpClient.kt:213) at com.atlassian.jira.migration.httpclient.AbstractPluginHttpClient.execute(AbstractPluginHttpClient.kt:72) at com.atlassian.jira.migration.httpclient.AbstractPluginHttpClient.execute(AbstractPluginHttpClient.kt:60) at com.atlassian.jira.migration.amsclient.DefaultAppMigrationServiceClient.execute(DefaultAppMigrationServiceClient.kt:483) at com.atlassian.jira.migration.progress.AppsProgressService.getAppProgressFromAMS(AppsProgressService.kt:171) at com.atlassian.jira.migration.progress.AppsProgressService.access$getAppProgressFromAMS(AppsProgressService.kt:21) at com.atlassian.jira.migration.progress.AppsProgressService$appProgressCache$2.invoke$lambda$0(AppsProgressService.kt:42) at com.atlassian.cache.memory.MemoryCacheManager$2.load(MemoryCacheManager.java:192) at com.atlassian.cache.memory.DelegatingCache.lambda$get$0(DelegatingCache.java:163) at com.atlassian.cache.memory.DelegatingCache.lambda$get$1(DelegatingCache.java:191) 

       

      Workaround

      Option 1

      Ensure you are authenticated for all the cloud sites you have migrated to. You can do this on 

      <server-url>/jira/secure/migration-app-action.jspa#/plan-configuration

      To review all the cloud sites that require authentication run the following query

      SELECT * FROM AO_6FF49D_MIGRATION_ENTITY
      INNER JOIN AO_6FF49D_PLAN_ENTITY ON AO_6FF49D_MIGRATION_ENTITY.PLAN_ID=AO_6FF49D_PLAN_ENTITY.ID
      WHERE APP_OUTCOME_JSON IS NULL; 
      

      Note: The cloud site with be in the `JSON` column.

      Option 2

      If you have lost access to the cloud site you can manually update the database to complete the app migration

      1. Find all the migrations that have not completed app migrations with a NULL app outcome and join it with plan table for more information.

      SELECT * FROM AO_6FF49D_MIGRATION_ENTITY 
      INNER JOIN AO_6FF49D_PLAN_ENTITY ON AO_6FF49D_MIGRATION_ENTITY.PLAN_ID=AO_6FF49D_PLAN_ENTITY.ID 
      WHERE APP_OUTCOME_JSON IS NULL;

      2. Update all migrations where you no longer have access to the cloud site with an app outcome for example update to an empty list to ignore the app outcome. This will result in a completed plan without any apps

      UPDATE AO_6FF49D_MIGRATION_ENTITY 
      SET APP_OUTCOME_JSON = '[]' 
      WHERE MIGRATION_ID = '<MIGRATION_ID>';

      2a. If we want a single query to update all problematic plans we can use

      UPDATE AO_6FF49D_MIGRATION_ENTITY 
      SET APP_OUTCOME_JSON = '[]' 
      WHERE APP_OUTCOME_JSON IS NULL

       

      NOTE: If you care about the plan showing the right apps you can provide some data. The serverAppKey and cloudAppKey can be found in the plan `JSON` field `includedApps` and `includedCloudApps` respectively

      UPDATE AO_6FF49D_MIGRATION_ENTITY 
      SET APP_OUTCOME_JSON = '[{"serverAppName": "Example app", "serverAppKey": "com.vendor.example", "cloudAppKey": "com.vendor.example", "completionPercent": 0, "isCancellable": false, "status": "FAILED"}]' 
      WHERE MIGRATION_ID = '<MIGRATION_ID>';

       For all the fields you can populate here is an example payload

      "serverAppName": "Example App",
      "serverAppKey": "com.vendor.app",
      "cloudAppKey": "com.vendor.app",
      "completionPercent": 0,
      "isCancellable": false,
      "status": "SKIPPED",
      "statusMessage": "Cannot run migration for this app. This could be because we failed to find a server listener while creating the app transfer. Please contact Atlassian support for more information.",
      "lastUpdatedAt": null,
      "appVendorName": "App Vendor Name",
      "contactVendorUrl": "https://marketplace.atlassian.com/apps/123/example-app?hosting=cloud&tab=support",
      "containerId": null,
      "notCancellableTooltip": null

       

            Assignee:
            Andre Rosot
            Reporter:
            David Yu
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: