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

Confluence cannot connect to Synchrony configured with non-standard -Dsynchrony.bind or -Dreza.bind

    XMLWordPrintable

Details

    Description

      Similar to CONF-45565, but affecting the interface rather than the port..

      When Confluence is started with -Dsynchrony.bind=127.0.1.1 or something other than localhost / 127.0.0.1, Synchrony starts up on the indicated interface, but Confluence is unable to contact Synchrony on this non-standard interface.

      Confluence ought to be using synchrony.bind when it constructs the 'Synchrony Internal Service URL. However it hardcodes 'localhost':

      [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] updateSynchronyConfiguration Synchrony External Base URL: http://localhost:8090/synchrony-proxy
      [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] updateSynchronyConfiguration Synchrony External Service URL: http://localhost:8090/synchrony-proxy/v1
      [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] updateSynchronyConfiguration Synchrony Internal Service URL: http://localhost:8091/synchrony/v1
      [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] updateSynchronyConfiguration Synchrony Resources URL: http://localhost:8090/synchrony-proxy/resources
      
      
      

      resulting in later editor failures:

      [plugins.synchrony.config.DefaultSynchronyConfigurationManager] retrievePublicKey [Collab editing plugin] Could not retrieve public key for real-time collaboration service at http://localhost:8091/synchrony/jwt-key with exception: Connect to localhost:8091 [localhost/127.0.0.1] failed: Connection refused
      [confluence.plugins.synchrony.SynchronyContextProvider] getContextMap Could not retrieve Synchrony public key.
      [plugins.synchrony.config.DefaultSynchronyConfigurationManager] retrievePublicKey [Collab editing plugin] Could not retrieve public key for real-time collaboration service at http://localhost:8091/synchrony/jwt-key with exception: Connect to localhost:8091 [localhost/127.0.0.1] failed: Connection refused
      [synchrony.api.v1.SynchronyTokenResource] generateToken Could not retrieve Synchrony public key. 
      

      Steps to replicate

      1. Start a new Standalone Confluence with -Dsynchrony.bind=127.0.1.1, e.g.:
        cd /tmp
        tar xf path/to/atlassian-confluence-6.0.2.tar.gz 
        cd atlassian-confluence-6.0.2/
        CATALINA_OPTS="-Dconfluence.home=$(pwd)/confhome -Dsynchrony.bind=127.0.1.1" ./bin/catalina.sh run
        
        

        (127.0.1.1 is a good example as it's usually defined by default on linux hosts, while still being distinct from localhost/127.0.0.1)

      1. Choose an install with sample data, set a license key and create an admin user.
      2. Once Confluence is finished its setup wizard, you can cerify that Synchrony is listening on the non-standard interface:
      $ netstat -ntpl | grep $(pgrep -f -u $USER 'synchrony.core sql')
      tcp6       0      0 127.0.1.1:8091          :::*                    LISTEN      13012/java      
      tcp6       0      0 127.0.0.1:25500         :::*                    LISTEN      13012/java      
      tcp6       0      0 :::5701                 :::*                    LISTEN      13012/java    
      
      
      1. Create a sample space.
      2. You will be left in an editor with a spinner, and the 'Loading the editor's taking longer than usual' error.

      Workaround

      1. No workaround.

      Solution

      In 6.0.4, we introduce a new system property synchrony.host that will allow Confluence to contact Synchrony via a custom hostname or IP address. synchrony.bind may still be needed for Synchrony to listen on a specific network interface.

      Attachments

        Issue Links

          Activity

            People

              ttranminh Tam Tran
              7c5359af675b Jeff Turner
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: