Connections could not be acquired from the underlying database

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

Confluence cannot start.

The following appears in the atlassian-confluence.log:

2007-11-06 14:13:01,020 WARN [Thread-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:104)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:264)
	at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
	at net.sf.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:33)
	at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
	at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
	at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803)
.....
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
	at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:972)
	at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
	at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:260)
2007-11-06 14:13:34,661 ERROR [Thread-1] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Connections could not be acquired from the underlying database!

OR :

....
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
	at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:675)
	at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:448)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
	at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:383)
	at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:776)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:432)
	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
	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)
2015-08-22 06:29:31,824 WARN [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] [mchange.v2.resourcepool.BasicResourcePool] run com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4055c4b9 -- 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: ORA-28001: the password has expired

Causes and Resolutions

Confluence cannot establish a connection to its database. There are a number of causes for this:

  1. The database configuration details you entered are incorrect or have changed. For example, the database name or database username/password for your Confluence database. Confirm that the database username, password, and connection URL in <confluence-home>/confluence.cfg.xml are correct, and if not update them accordingly.
  2. The URL for the database is incorrect. For example, if the database connection is jdbc:mysql://yma/confluence?autoReconnect=true, does the host 'yma' exist and is the database server installed on 'yma'? Check <confluence-home>/confluence.cfg.xml to find this entry.
  3. The database server is not running. If your database server is down, restart it and check the logs to see why it had failed or stopped.
  4. The network is down (or there is a firewall in between Confluence and its database) and the connection to the database cannot be established. If your network is down, or a new firewall is installed, consult with your System Administrator for further troubleshooting.
  5. Your database password has expired. If your password has expired (and you will only discover this if you try to connect to your database via your database client or an external database tool such as DbVisualizer), update your password. You may want to deactivate expiring passwords for your Confluence database user to prevent the problem from happening again. Be sure to consult with your DBA about this.

  6. Postgres specific issue: the Postgres encryption method has been altered or changed when migrating or upgrading Confluence, the environment, etc. Check the pg_hba.conf file. If the method is set to ident change it to md5.
  7. MySQL specific issue: there are too many connection requests that triggered MySQL server to block Confluence from making any requests. See this MySQL article for resolution.
Last modified on Jan 26, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.