When migrating a Calendar in Confluence, if it contains events from another instance linked by app link import auth error

XMLWordPrintable

    • 3
    • Minor

      Issue Summary

      When importing a Calendar into Confluence Cloud, if the calendar contains Jira events from another Cloud instance, linked by application link, these events won't load with a message "Unable to load events of xxxxx: java.lang.RuntimeException: com.atlassian.applinks.api.CredentialsRequiredException: You do not have an authorized access token for the remote resource."

      Steps to Reproduce

      1. Create an Application Link to the other Cloud instance.
      2. Import a .ics calendar in Confluence.
      3. Events from another Jira instance will not load.

      Expected Results

      A modal should open to allow read and write from the destination site.

      Actual Results

      This modal does not appear and the following error occurs:

      These logs are found in the backend of the Cloud instance, as a WARN.

      java.util.concurrent.CompletionException: com.atlassian.vcache.ExternalCacheException: Failed due to UNCLASSIFIED_FAILURE
      java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:2
      java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:
      java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1095)
      java.util.concurrent.CompletableFuture.biApplyStage(CompletableFuture.java:1120)
      java.util.concurrent.CompletableFuture.thenCombine(CompletableFuture.java:2025)
      java.util.concurrent.CompletableFuture.thenCombine(CompletableFuture.java:110)
      com.atlassian.confluence.extra.calendar3.util.ComplexKeyedExternalCache.get(ComplexKeyedExternalCache.java:181)
      com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.getCachedSubCalendarContent(CalendarDataStoreCachingDecorator.jav
      com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.getSubCalendarContent(CalendarDataStoreCachingDecorator.java:217)
      com.atlassian.confluence.extra.calendar3.calendarstore.ChildJiraSubCalendarDataStoreCachingDecorator.getSubCalendarContent(ChildJiraSubCalendarDataStoreCachingDecorator.java:62)
      com.atlassian.confluence.extra.calendar3.calendarstore.ChildJiraSubCalendarDataStoreCachingDecorator.getSubCalendarContent(ChildJiraSubCalendarDataStoreCachingDecorator.java:27)
      com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.findEvents(CalendarDataStoreCachingDecorator.java:501)
      com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.getEvents(CalendarDataStoreCachingDecorator.java:467)
      ......
      
      Caused by: com.atlassian.vcache.ExternalCacheException: Failed due to UNCLASSIFIED_FAILURE
      com.atlassian.vcache.internal.memcached.MemcachedUtils.mapException(MemcachedUtils.java:90)
      com.atlassian.vcache.internal.memcached.MemcachedStableReadExternalCache.mapException(MemcachedStableReadExternalCache.java:176)
      com.atlassian.vcache.internal.core.service.AbstractExternalCache.perform(AbstractExternalCache.java:99)
      com.atlassian.vcache.internal.core.service.AbstractExternalCache.perform(AbstractExternalCache.java:74)
      com.atlassian.vcache.internal.core.service.AbstractStableReadExternalCache.get(AbstractStableReadExternalCache.java:1
      ......
      
      Caused by: java.lang.RuntimeException: com.atlassian.applinks.api.CredentialsRequiredException: You do not have an authorized access token for the remote resource.
      com.google.common.base.Throwables.propagate(Throwables.java:160)
      com.atlassian.confluence.util.ThrowableFunctions.lambda$uncheckSupplier$3(ThrowableFunctions.java:132)
      com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.lambda$getCachedSubCalendarContent$4(CalendarDataStoreCachingDecorator.java:261)
      ......
      
      Caused by: com.atlassian.applinks.api.CredentialsRequiredException: You do not have an authorized access token for the remote resource.
      com.atlassian.applinks.oauth.auth.ThreeLeggedOAuthRequestFactoryImpl.retrieveConsumerToken(ThreeLeggedOAuthRequestFactoryImpl.java:168)
      com.atlassian.applinks.oauth.auth.ThreeLeggedOAuthRequestFactoryImpl.createRequest(ThreeLeggedOAuthRequestFactoryImpl.java:119)
      com.atlassian.applinks.core.auth.ApplicationLinkRequestFactoryFactoryImpl$AbsoluteURLRequestFactory.createRequest(ApplicationLinkRequestFactoryFactoryImpl.java:185)
      .....
      
      Exception encountered when retrieving value with a supplier in com.atlassian.confluence.extra.calendar3.calendarstore.generic.AgileSprintsSubCalendarDataStore_subcalendar-data for key XXXXXXXX:jira://XXXXX?projectKey=xxx&dateFieldName=sprint:rangedate:1572566400000-1584057600000
      

      Workaround

      On a page of Confluence, click on the Jira issue macro, select the instance connected via application link and click to Login & Approve. After approving the access it should load the events normally.

            Assignee:
            Byron Walker
            Reporter:
            Daniel Brito [Atlassian]
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: