Unable to start Confluence after a environment restart - The TCP/IP connection to the database was refused
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
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.
環境
- Confluence Server 6.15.6
- MS SQL Server 2016
診断
The following entries are shown in the application logs:
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
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.".
原因
- The database wasn't accessible when Confluence started;
- Database couldn't be reached through the network interface for authentication.
ソリューション
Wait until the database is ready for connections before starting Confluence.