Unable to start Confluence after a environment restart - The TCP/IP connection to the database was refused

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

After restarting the complete environment (application + database), Confluence is unable to start. 

Connection errors appear in the application logs, indicating that Confluence was unable to establish a connection to the database. However, the database connection settings are unchanged since the last restart.

Environment

  • Confluence Server 6.15.6

  • MS SQL Server 2016

Diagnosis

The following entries are shown in the application logs:

atlassian-confluence.log

1 YYYY-MM-DD HH:mm:ss,ms WARN [Task-Thread-for-com.mchange.v2.async.ThreadPerTaskAsynchronousRunner@1672f20] [sqlserver.jdbc.internals.SQLServerConnection] Prelogin ConnectionID:1049 ClientConnectionId: e131e198-cc03-478d-ac1d-604bada5b707 Prelogin error: host <database_host> port <database_port> Unexpected response type:18

atlassian-confluence.log

1 2 YYYY-MM-DD HH:mm:ss,ms WARN [C3P0PooledConnectionPoolManager[identityToken->308jkza81lg8mf1yrxwv5|42f01688]-HelperThread-#1] [mchange.v2.resourcepool.BasicResourcePool] log com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@31ef63ca -- 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.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host <database_host>, port <database_port> has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

Cause

  • The database wasn't accessible when Confluence started;

  • Database couldn't be reached through the network interface for authentication.

Solution

Wait until the database is ready for connections before starting Confluence.

Updated on March 17, 2025

Still need help?

The Atlassian Community is here for you.