• Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 5.8.17
    • None

      It seems that there is a bug in the jTDS driver within Confluence, related to SSL connections to SQL Server, see here:

      http://sourceforge.net/p/jtds/bugs/725/

      Similar bug report for JIRA: https://jira.atlassian.com/browse/JRA-39866

      Problem

      Confluence attempting to connect to SQL Server over SSL results in Network error IOException: Connection reset.

      If upgrading from a version of Confluence using Java 1.7, Confluence will not start up after the upgrade and the following appears in atlassian-confluence.log:

      2015-11-24 16:14:38,738 WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] [mchange.v2.resourcepool.BasicResourcePool] run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6478f87d -- 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: 
      java.sql.SQLException: Network error IOException: Connection reset
      	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:385)
      	at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
      	at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
      	at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
      	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
      	at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
      	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
      	at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
      	at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
      	at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
      	at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
      Caused by: java.net.SocketException: Connection reset
      	at java.net.SocketInputStream.read(SocketInputStream.java:209)
      	at java.net.SocketInputStream.read(SocketInputStream.java:141)
      	at net.sourceforge.jtds.ssl.TdsTlsInputStream.readFully(TdsTlsInputStream.java:131)
      	at net.sourceforge.jtds.ssl.TdsTlsInputStream.primeBuffer(TdsTlsInputStream.java:100)
      	at net.sourceforge.jtds.ssl.TdsTlsInputStream.read(TdsTlsInputStream.java:78)
      	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
      	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
      	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
      	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
      	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
      	at net.sourceforge.jtds.ssl.SocketFactories$TdsTlsSocketFactory.createSocket(SocketFactories.java:102)
      	at net.sourceforge.jtds.jdbc.SharedSocket.enableEncryption(SharedSocket.java:336)
      	at net.sourceforge.jtds.jdbc.TdsCore.negotiateSSL(TdsCore.java:547)
      	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:338)
      	... 10 more
      2015-11-24 16:14:38,743 WARN [localhost-startStop-1] [sf.hibernate.cfg.SettingsFactory] buildSettings Could not obtain connection metadata
      java.sql.SQLException: Connections could not be acquired from the underlying database!
      	at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
      	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
      	at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
      	at net.sf.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
      	at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
      	at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1191)
      	at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:822)
      	at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:540)
      	at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:474)
      	at

      Environment

      • Java 1.8
      • SSL connection specified in db connection string: ";ssl=true"
      • Confluence is using jtds driver

      Steps to Reproduce

      1. Install Confluence 5.8.17 using the embedded JRE (1.8)
      2. Use the default jtds driver installed with Confluence
      3. Attempt to connect to a database with a secure connection - adding ;ssl=true to the database connection string.

      Workaround

            [CONFSERVER-40046] Java 1.8 and jTDS Sql Server SSL Connection Issues

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2889875 ] New: CONFSERVER Bug Workflow v4 [ 3000503 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2803057 ] New: JAC Bug Workflow v3 [ 2889875 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2734584 ] New: JAC Bug Workflow v2 [ 2803057 ]
            Owen made changes -
            Symptom Severity Original: Major [ 14431 ] New: Severity 2 - Major [ 15831 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2372819 ] New: JAC Bug Workflow [ 2734584 ]
            Adam Barnes (Inactive) made changes -
            Resolution New: Obsolete [ 11 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]

            This issue has been resolved in later versions of Confluence.

            Adam Barnes (Inactive) added a comment - This issue has been resolved in later versions of Confluence.
            Bugfix Automation Bot made changes -
            Support reference count Original: 5 New: 6
            Bugfix Automation Bot made changes -
            UIS New: 1
            Bugfix Automation Bot made changes -
            UIS Original: 1

              Unassigned Unassigned
              jbennett@atlassian.com J van Leeuwen
              Affected customers:
              1 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: