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

[Confluence 6.0] Synchrony: Connections could not be acquired from the underlying database

      Issue originally raised by Dmitry Pashkevich over at: https://ecosystem.atlassian.net/browse/CE-662

      I'm trying to run Confluence 6.0 to test my add-on, however it looks like Synchrony won't aquire database connections for some reason.
      Here's my environment:

      $ atlas-version
      
      ATLAS Version:    6.2.4
      ATLAS Home:       /usr/share/atlassian-plugin-sdk-6.2.4
      ATLAS Scripts:    /usr/share/atlassian-plugin-sdk-6.2.4/bin
      ATLAS Maven Home: /usr/share/atlassian-plugin-sdk-6.2.4/apache-maven-3.2.1
      AMPS Version:     6.2.3
      --------
      Executing: /usr/share/atlassian-plugin-sdk-6.2.4/apache-maven-3.2.1/bin/mvn --version -gs /usr/share/atlassian-plugin-sdk-6.2.4/apache-maven-3.2.1/conf/settings.xml
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
      Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
      Maven home: /usr/share/atlassian-plugin-sdk-6.2.4/apache-maven-3.2.1
      Java version: 1.8.0_101, vendor: Oracle Corporation
      Java home: /usr/lib/jvm/java-8-oracle/jre
      Default locale: en_US, platform encoding: UTF-8
      OS name: "linux", version: "3.13.0-91-generic", arch: "amd64", family: "unix"
      

      Here's how I run Confluence:

      atlas-debug -v 6.0.0-m70
      

      Here's what I see in the startup logs:

      [INFO] [talledLocalContainer] 2016-09-07 18:55:05,957 DEBUG [282:StdOutHandler java.lang.UNIXProcess@e684b3d] [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] processLine Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> z8kflt9j22ywl01p5jqnx|4fb1caf1, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> org.h2.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> z8kflt9j22ywl01p5jqnx|4fb1caf1, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:h2:tcp://localhost:9092//home/dmitry/lucid/main/confluence/target/confluence/home/database/h2db;MVCC=TRUE, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 10800, maxIdleTimeExcessConnections -> 1800, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
      [INFO] [talledLocalContainer] 2016-09-07 18:55:36,112 DEBUG [282:StdOutHandler java.lang.UNIXProcess@e684b3d] [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] processLine com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@25555dcc -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
      [INFO] [talledLocalContainer] 2016-09-07 18:55:36,113 DEBUG [282:StdOutHandler java.lang.UNIXProcess@e684b3d] [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] processLine org.h2.jdbc.JdbcSQLException: Connection is broken: "unexpected status 16777216" [90067-176]
      
      <...>
      
      [INFO] [talledLocalContainer] 2016-09-07 18:56:06,229 DEBUG [282:StdOutHandler java.lang.UNIXProcess@e684b3d] [plugins.synchrony.bootstrap.DefaultSynchronyProcessManager] processLine Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
      

      Full log attached.

        1. pom.xml
          4 kB
          Dmitry Pashkevich
        2. screenshot-1.png
          172 kB
          Dmitry Pashkevich
        3. screenshot-2.png
          268 kB
          Dmitry Pashkevich
        4. startup-full.log
          1.57 MB
          Dmitry Pashkevich
        5. startup-h2-1.3.log
          1.60 MB
          Dmitry Pashkevich
        6. synchrony_error.log
          51 kB
          Brendan McNamara
        7. version.xml
          0.8 kB
          Dmitry Pashkevich

            [CONFSERVER-43674] [Confluence 6.0] Synchrony: Connections could not be acquired from the underlying database

            Thanks for the update Brendan. I logged a separate ticket on H2 compatibility: https://ecosystem.atlassian.net/servicedesk/customer/portal/14/DEVHELP-24
            I wonder if the issue here is simply that Synchrony has a hard-coded dependency on H2 1.3, so there's a problem when Confluence itself uses 1.4. There should be a way for Synchrony to inherit libArtifacts from the add-on's pom.xml.

            Dmitry Pashkevich added a comment - Thanks for the update Brendan. I logged a separate ticket on H2 compatibility: https://ecosystem.atlassian.net/servicedesk/customer/portal/14/DEVHELP-24 I wonder if the issue here is simply that Synchrony has a hard-coded dependency on H2 1.3, so there's a problem when Confluence itself uses 1.4. There should be a way for Synchrony to inherit libArtifacts from the add-on's pom.xml.

            Hi dmitry35, sorry we are currently not looking into upgrading to use 1.4. We will look at upgrading in the future but it is not planned for the 6.0 release.

            Brendan McNamara (Inactive) added a comment - Hi dmitry35 , sorry we are currently not looking into upgrading to use 1.4. We will look at upgrading in the future but it is not planned for the 6.0 release.

            Hey Brendan, is there any update on using Synchrony with H2 1.4?

            Dmitry [Lucidchart] added a comment - Hey Brendan, is there any update on using Synchrony with H2 1.4?

            We are tracking the AMPS issue here now https://jira.atlassian.com/browse/CONF-43804. I am going to resolve this ticket. Please let me know by commenting here if you have unresolved issues mentioned here that have not been raised in a new ticket. Thanks!

            Brendan McNamara (Inactive) added a comment - We are tracking the AMPS issue here now https://jira.atlassian.com/browse/CONF-43804 . I am going to resolve this ticket. Please let me know by commenting here if you have unresolved issues mentioned here that have not been raised in a new ticket. Thanks!

            I know, but it's a lot easier to use than the official image, so that's why I thought I'd give it a try. Also, it looks like there's no official docker image for 6.0 yet https://bitbucket.org/atlassian/docker-atlassian-confluence-server/src/3ff588a0a9e5b7e77d2d8d01ca6d03a6cc513967/Dockerfile?at=master&fileviewer=file-view-default

            Dmitry Pashkevich added a comment - I know, but it's a lot easier to use than the official image, so that's why I thought I'd give it a try. Also, it looks like there's no official docker image for 6.0 yet https://bitbucket.org/atlassian/docker-atlassian-confluence-server/src/3ff588a0a9e5b7e77d2d8d01ca6d03a6cc513967/Dockerfile?at=master&fileviewer=file-view-default

            Hi dpashk, that is not an official atlassian docker image so I'm afraid we won't be able to do much right now to support you in getting that working.

            Brendan McNamara (Inactive) added a comment - Hi dpashk , that is not an official atlassian docker image so I'm afraid we won't be able to do much right now to support you in getting that working.

            I tried running a docker image of Confluence EAP (https://hub.docker.com/r/cptactionhank/atlassian-confluence/), it seems to be having some other issues with Synchrony, I haven't dug deeper into them so far, but at least this one should be easily reproducible


            Dmitry Pashkevich added a comment - I tried running a docker image of Confluence EAP ( https://hub.docker.com/r/cptactionhank/atlassian-confluence/ ), it seems to be having some other issues with Synchrony, I haven't dug deeper into them so far, but at least this one should be easily reproducible

            I can't easily remove HTTPS from my local development stack because we try to have our development environments mimic the production configuration as much as feasibly possible, and our web server enforces HSTS, which forces the browser to make all requests to xxx.lucidchart.com via HTTPS.

            I could get Confluence itself to run via HTTP, but then I couldn't be able to connect it to my add-on since it iframes some pages from our product that enforces HTTPS. Hope that makes sense.

            Dmitry Pashkevich added a comment - I can't easily remove HTTPS from my local development stack because we try to have our development environments mimic the production configuration as much as feasibly possible, and our web server enforces HSTS, which forces the browser to make all requests to xxx.lucidchart.com via HTTPS. I could get Confluence itself to run via HTTP, but then I couldn't be able to connect it to my add-on since it iframes some pages from our product that enforces HTTPS. Hope that makes sense.

            I have raised https://jira.atlassian.com/browse/CONF-43804 to track the AMPS issue.

            Brendan McNamara (Inactive) added a comment - I have raised https://jira.atlassian.com/browse/CONF-43804 to track the AMPS issue.

            Hey dpashk,

            Looks like we have a problem with using AMPS and HTTPS. As a workaround is it possible to do a clean install of Confluence 6.0.0-beta3 using the installer. This should unblock you while we investigate the AMPS issue.

            Also, if you could remove HTTPS from you local development configuration then it should work. Can you elaborate on why you need to use HTTPS in local dev environment?

            I have removed the security restrictions from this ticket so Owen Krafft should have access now.

            Brendan McNamara (Inactive) added a comment - - edited Hey dpashk , Looks like we have a problem with using AMPS and HTTPS. As a workaround is it possible to do a clean install of Confluence 6.0.0-beta3 using the installer. This should unblock you while we investigate the AMPS issue. Also, if you could remove HTTPS from you local development configuration then it should work. Can you elaborate on why you need to use HTTPS in local dev environment? I have removed the security restrictions from this ticket so Owen Krafft should have access now.

              jxie Chii (Inactive)
              facbc3cca0e3 Dmitry Pashkevich
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: