java.sql.SQLException: Network error IOException: Connection reset

Atlassian JIRA | Jennifer Bennett [Atlassian] | 1 year ago
  1. 0

    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 h3. 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: {code}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{code} h3. Environment * Java 1.8 * SSL connection specified in db connection string: ";ssl=true" * Confluence is using jtds driver h3. Steps to Reproduce # Install Confluence 5.8.17 using the embedded JRE (1.8) # Use the default jtds driver installed with Confluence # Attempt to connect to a database with a secure connection - adding ;ssl=true to the database connection string. h3. Workaround * Switch the Java version used to 1.7 * Turn off SSL * Use Microsoft's JDBC drivers. * Use this patch: http://sourceforge.net/p/jtds/patches/129/ or http://sourceforge.net/p/jtds/bugs/_discuss/thread/16113049/7594/attachment/jtds-1.3.1.jar

    Atlassian JIRA | 1 year ago | Jennifer Bennett [Atlassian]
    java.sql.SQLException: Network error IOException: Connection reset
  2. 0

    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 h3. 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: {code}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{code} h3. Environment * Java 1.8 * SSL connection specified in db connection string: ";ssl=true" * Confluence is using jtds driver h3. Steps to Reproduce # Install Confluence 5.8.17 using the embedded JRE (1.8) # Use the default jtds driver installed with Confluence # Attempt to connect to a database with a secure connection - adding ;ssl=true to the database connection string. h3. Workaround * Switch the Java version used to 1.7 * Turn off SSL * Use Microsoft's JDBC drivers. * Use this patch: http://sourceforge.net/p/jtds/patches/129/ or http://sourceforge.net/p/jtds/bugs/_discuss/thread/16113049/7594/attachment/jtds-1.3.1.jar

    Atlassian JIRA | 1 year ago | Jennifer Bennett [Atlassian]
    java.sql.SQLException: Network error IOException: Connection reset
  3. 0

    jTDS - SQL Server and Sybase JDBC driver / Bugs / #725 jTDS driver ssl connection hangs with JRE 1.8

    sourceforge.net | 11 months ago
    java.sql.SQLException: Network error IOException: Connection reset
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    jTDS - SQL Server and Sybase JDBC driver / Bugs / #725 jTDS driver ssl connection hangs with JRE 1.8

    sourceforge.net | 3 months ago
    java.sql.SQLException: Network error IOException: Connection reset
  6. 0

    Connection Reset with db-connect and MS SQL - Question | Splunk Answers

    splunk.com | 3 months ago
    java.sql.SQLException: Network error IOException: Connection reset

  1. Aria Pahlavan 9 times, last 1 week ago
  2. serious2monkeys 1 times, last 2 weeks ago
  3. tvrmsmith 1 times, last 3 weeks ago
  4. archenroot 2 times, last 4 weeks ago
  5. balintn 4 times, last 1 week ago
20 more registered users
75 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.SocketException

    Connection reset

    at java.net.SocketInputStream.read()
  2. Java RT
    SocketInputStream.read
    1. java.net.SocketInputStream.read(SocketInputStream.java:209)
    2. java.net.SocketInputStream.read(SocketInputStream.java:141)
    2 frames
  3. jTDS
    TdsTlsInputStream.read
    1. net.sourceforge.jtds.ssl.TdsTlsInputStream.readFully(TdsTlsInputStream.java:131)
    2. net.sourceforge.jtds.ssl.TdsTlsInputStream.primeBuffer(TdsTlsInputStream.java:100)
    3. net.sourceforge.jtds.ssl.TdsTlsInputStream.read(TdsTlsInputStream.java:78)
    3 frames
  4. Java JSSE
    SSLSocketImpl.startHandshake
    1. sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
    2. sun.security.ssl.InputRecord.read(InputRecord.java:503)
    3. sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    4. sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    5. sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    6. sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    6 frames
  5. jTDS
    Driver.connect
    1. net.sourceforge.jtds.ssl.SocketFactories$TdsTlsSocketFactory.createSocket(SocketFactories.java:102)
    2. net.sourceforge.jtds.jdbc.SharedSocket.enableEncryption(SharedSocket.java:336)
    3. net.sourceforge.jtds.jdbc.TdsCore.negotiateSSL(TdsCore.java:547)
    4. net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:338)
    5. net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
    6. net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
    6 frames
  6. c3p0:JDBC DataSources/Resource Pools
    ThreadPoolAsynchronousRunner$PoolThread.run
    1. com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
    2. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
    3. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
    4. com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
    5. com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
    6. com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
    7. com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
    8. com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
    8 frames