com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Atlassian JIRA | Hanis Suhailah | 5 months ago
  1. 0

    h4. Problem HipChat Server locked out admin from logging in successfully after a fresh server deployment h4. Environment HipChat Server v2.0 build 1.4.2 (fresh OVA installs) h4. Steps to reproduce # Deploy HipChat Server and follow through the setup wizard # You'll be prompted to restart the server # Once server restarted, you'l be directed to the login page # Specify your credentials that you have configured during setup wizard and login h4. Expected Result User able to login to the server h4. Actual Result User unable to login to the server h5. The cause of the problem This issue appears to be a side effect of this bug: [HipChat Server Chef run fails with 'Ran /etc/init.d/nginx start returned 1' Chef error|https://jira.atlassian.com/browse/HCPUB-1045]. Because of that, there is a race condition in initial server boot up preventing user from logging in after HipChat Server setup. User is able to access/complete setup wizard however Chef (configuration manager) run failed and in affect to that Crowd service was unable to access the database successfully preventing authentication. This is seen in _/var/log/hipchat/atlassian-crowd.log_: {code} 2016-06-30 23:57:27,974 C3P0PooledConnectionPoolManager[identityToken->z8kflt9h19ffaq81ieite6|2fe4d2bd]-HelperThread-#2 WARN [mchange.v2.resourcepool.BasicResourcePool] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@637e128e -- 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: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. at sun.reflect.GeneratedConstructorAccessor25.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2395) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2316) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648) Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1750) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1290) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493) at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2334) ... 18 more {code} h4. Workaround Follow the suggested workaround mentioned in this bug report: [HipChat Server Chef run fails with 'Ran /etc/init.d/nginx start returned 1' Chef error|https://jira.atlassian.com/browse/HCPUB-1045] or apply the mentioned patch to fix the problem.

    Atlassian JIRA | 5 months ago | Hanis Suhailah
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  2. 0

    Why am I getting these exceptions?

    Stack Overflow | 1 year ago | JavaStack
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  3. 0

    Unable to run traccar after reinstallation for 3.1 upgrade

    GitHub | 1 year ago | webmst
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    jdbc4 Archives - BlogoSfera

    co.uk | 1 year ago
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  6. 0

    Connecting to MariaDB using JDBC / c3p0

    Stack Overflow | 8 months ago | Datageek
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

  1. tvrmsmith 10 times, last 3 weeks ago
  2. MoYapro 1 times, last 2 months ago
1 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.sql.SQLException

    Access denied for user 'root'@'localhost' (using password: YES)

    at com.mysql.jdbc.SQLError.createSQLException()
  2. MySQL jdbc
    JDBC4Connection.<init>
    1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
    2. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
    3. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
    4. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
    5. com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1750)
    6. com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1290)
    7. com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
    8. com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2334)
    9. com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2316)
    10. com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
    11. com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    11 frames
  3. Java RT
    Constructor.newInstance
    1. sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source)
    2. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    3. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    3 frames
  4. MySQL jdbc
    NonRegisteringDriver.connect
    1. com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    2. com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
    3. com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
    3 frames
  5. c3p0:JDBC DataSources/Resource Pools
    ThreadPoolAsynchronousRunner$PoolThread.run
    1. com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:146)
    2. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195)
    3. com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184)
    4. com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
    5. com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
    6. com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
    7. com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
    8. com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)
    9. com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)
    9 frames