How to address "Error establishing a database connection" Or "Web server took too long to respond" or "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible." errors when upgrading or installing Orchestrator?
Issue Description:
When upgrading or setting up UiPath Orchestrator, particularly in environments using SQL Server, there might be errors related to establishing a database connection. These errors can occur due to various reasons, including incorrect connection strings in clustered SQL environments or connectivity issues between the web server and the database server.
This article provides solutions for resolving SQL connection errors, both for clustered SQL environments and non-clustered setups.
Resolution:
1. For Clustered SQL Environments:
During an upgrade to UiPath Orchestrator 2020.4.3 in a clustered SQL environment, the following error is thrown:
System.Exception: Error: 70, Message: An error has occurred while installing the database. A network-related or instance-specific error occurred while establishing a connection to SQL Server.
Resolution: Update the SQL connection string in the following format:
Ensure the SQL cluster name is used, not individual IPs or hostnames, to successfully complete the upgrade.
Root Cause:
This error occurs if the SQL connection string uses an individual IP address instead of the cluster name. In a clustered environment, the Orchestrator cannot resolve how to reach SQL and perform the necessary upgrades.2. For Non-Clustered SQL Environments (Relevant for All Versions of Orchestrator):
If a general "Error establishing a database connection" during installation is encountered or when the Orchestrator web server takes too long to respond, follow these troubleshooting steps:
a) Check Connectivity Between Web Server and Database Server:
Ensure there are no connectivity issues between the Orchestrator server and the SQL server. To test, use the telnet
command from the Orchestrator server:
telnet [database domain name or IP] [port]
Example:
telnet 192.168.0.10 1433
If Telnet is not installed, follow the steps for enabling Telnet Client on your server, which varies depending on your OS (Windows Server, Windows 10, etc.).
b) Verify ODBC Connection:
Check if the ODBC connection from the UiPath Orchestrator web server to the database is functioning:
- Open Control Panel → System and Security → Administrative Tools → Data Sources (ODBC).
- Select the DSN you want to test, then Configure and Test Connection.
If the connection test fails, consult with the database administrator.
c) Check if the Database Server is Down:
If the database server is down, it will not be possible to connect:
- Open SQL Server Management Studio and manually attempt a connection to the SQL instance.
- If connection fails, ensure the database server is running, or check for other underlying issues.