Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-58927

If the Marketplace is unreachable, UPM causes Confluence 7.0.1 to hang for 30sec per UI click

XMLWordPrintable

      Issue Summary

      If the Marketplace is unreachable, UPM 4.0.6 causes Confluence 7.0.1 to hang for 30sec per UI click.

      Environment

      • UPM 4.0.6 in Confluence 7.0.1
      • marketplace.atlassian.com non-responsive. This needs to be a timeout, not a straight connection refusal by a firewall.

      Steps to Reproduce

      1. Add entry in /etc/hosts to simulate marketplace being unreachable:
         203.56.8.1 marketplace.atlassian.com
        
      1. Click anything in Confluence and get ready to wait, and wait....

      Expected Results

      The Confluence UI should remain responsive even if Marketplace is unreachable.

      Actual Results

      The result of each click in the UI (eg. clicking on Spaces, or trying to load the Confluence admin screen) takes approximately 30 seconds, giving the impression that Confluence performance is very poor.

      Notes

      If the IP that marketplace.atlassian.com resolves to refuses or accepts the connection immediately, there is no problem - it's only when the resolved IP fails to connect and eventually times out.

      Confluence thread dump on a hanging thread:

      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      - locked [0x00000007bdeaf1e8] (a java.net.SocksSocketImpl)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589) 
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:339)
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
      at org.apache.http.impl.client.cache.CachingExec.callBackend(CachingExec.java:592)
      at org.apache.http.impl.client.cache.CachingExec.handleCacheMiss(CachingExec.java:356)
      at org.apache.http.impl.client.cache.CachingExec.execute(CachingExec.java:275) 
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at com.atlassian.marketplace.client.impl.CommonsHttpTransport$OperationsImpl.executeMethod(CommonsHttpTransport.java:389)
      at com.atlassian.marketplace.client.impl.CommonsHttpTransport$OperationsImpl.get(CommonsHttpTransport.java:303)
      at com.atlassian.marketplace.client.impl.CommonsHttpTransport.get(CommonsHttpTransport.java:115)
      at com.atlassian.marketplace.client.impl.ApiHelper.getEntityInternal(ApiHelper.java:114)
      at com.atlassian.marketplace.client.impl.ApiHelper.getEntity(ApiHelper.java:101)
      at com.atlassian.marketplace.client.impl.DefaultMarketplaceClient.getRoot(DefaultMarketplaceClient.java:156)
      at com.atlassian.marketplace.client.impl.DefaultMarketplaceClient.applications(DefaultMarketplaceClient.java:121) 
      at com.atlassian.upm.pac.PacClientImpl.fetchMpacAppInfo(PacClientImpl.java:228)
      at com.atlassian.upm.pac.PacClientImpl.fetchMpacAppInfoForLocalBuild(PacClientImpl.java:252)
      at com.atlassian.upm.pac.PacClientImpl.lambda$createMpacAppRef$1(PacClientImpl.java:217)
      at com.atlassian.upm.pac.PacClientImpl$$Lambda$964/1871514796.get(Unknown Source)
      at com.atlassian.confluence.cache.DeferredCachedReference.get(DeferredCachedReference.java:61)
      at com.atlassian.confluence.cache.TransactionalCacheFactory$TransactionAwareCachedReference.get(TransactionalCacheFactory.java:396)
      at com.atlassian.upm.pac.PacClientImpl.mpacApp(PacClientImpl.java:277)
      at com.atlassian.upm.pac.PacClientImpl.unknownAppVersion(PacClientImpl.java:281)
      at com.atlassian.upm.pac.PacClientImpl.isUnknownProductVersion(PacClientImpl.java:272) 
      at com.atlassian.upm.permission.UpmVisibilityImpl.isKnownOrDevelopmentVersion(UpmVisibilityImpl.java:72)
      at com.atlassian.upm.permission.UpmVisibilityImpl.isInstallVisible(UpmVisibilityImpl.java:45)
      at com.atlassian.upm.conditions.IsPermittedToView.shouldDisplay(IsPermittedToView.java:61)
      at com.atlassian.plugin.web.DefaultWebInterfaceManager.filterFragmentsByCondition(DefaultWebInterfaceManager.java:160)
      at com.atlassian.plugin.web.DefaultWebInterfaceManager.getDisplayableItems(DefaultWebInterfaceManager.java:113)
      at com.atlassian.confluence.plugin.descriptor.web.ConfluenceWebInterfaceManager.getDisplayableItems(ConfluenceWebInterfaceManager.java:78)
      at com.atlassian.confluence.web.ConfluenceWebMenuManager.getSectionItems(ConfluenceWebMenuManager.java:48)
      at com.atlassian.confluence.web.ConfluenceWebMenuManager.getMenu(ConfluenceWebMenuManager.java:32)

      Stuck Thread

      catalina.out may report stuck threads that are related to the Marketplace connection:

      		at com.atlassian.upm.pac.PacClientImpl.mpacApp(PacClientImpl.java:277)
      		at com.atlassian.upm.pac.PacClientImpl.unknownAppVersion(PacClientImpl.java:281)
      		at com.atlassian.upm.pac.PacClientImpl.isUnknownProductVersion(PacClientImpl.java:272)
      		at com.atlassian.upm.permission.UpmVisibilityImpl.isKnownOrDevelopmentVersion(UpmVisibilityImpl.java:72)
      		at com.atlassian.upm.permission.UpmVisibilityImpl.isInstallVisible(UpmVisibilityImpl.java:45)
      		at com.atlassian.upm.conditions.IsPermittedToView.shouldDisplay(IsPermittedToView.java:61)
      

      Workaround

      In Confluence, disable connectivity to Marketplace:

      1. Navigate to the cog icon > General Configuration > Manage Apps
      2. Click on Settings at the bottom of the page
      3. Uncheck Connect to Atlassian Marketplace and click Apply

      Workaround via REST API

      If Confluence is completely inaccessible we can use the following REST API to disable connectivity to Marketplace.

      curl -u username:password -X PUT <Confluence Base URL>/rest/plugins/1.0/settings -H 'Content-Type: application/vnd.atl.plugins+json' --data-binary '{"settings":[{"key":"pacDisabled","value":true,"requiresRefresh":true,"defaultCheckedValue":true,"readOnly":false}]}'
      

      This ticket is also tracked under UPM-6053

              hrehioui Hasnae (Inactive)
              mninnes@atlassian.com Malcolm Ninnes
              Votes:
              11 Vote for this issue
              Watchers:
              53 Start watching this issue

                Created:
                Updated:
                Resolved: