Network Management
SolarWinds Platform is unable to connect to the database
This article discusses about the following error when connecting to Orion database: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.'
First published date
Last published date
Overview
- The following exception occurred on the platform when the connection with the database was lost:
Exception A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Connection string - Data Source=*SQL SERVER NAME*;Initial Catalog=*DB NAME*_Prod;User ID=*DB USER NAME*;Password=*******;Connect Timeout=20;Load Balance Timeout=120;Application Name=SolarWinds.DataProcessor@domain-DataProcessorHost-0;Workstation ID=*MACHINE ID*
There was not a database incident during this period. - Service was unable to open a new database connection when requested.
Related errors
Database configuration failed:
• Exception while configuring plugin Orion Core Services component Orion Database. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Product section
Cause
- Network / Firewall
- SQL server browser sevice
- DNS for vIP or vIP for SQL Server no longer accessible
- Expired SQL license or an expired trial license Or SQL Express limitation breached
Resolution
Troubleshooting steps:
- Verify that SQL Server and SQL Server Browser services are running
- Check and disable windows firewall on the SQL server
- Install third-party tools for checking the database connectivity
- Further troubleshooting links
- Checking if the DNS for the vIP of the SQL Server HA pool is resolving.
- Check if DBA have added all Orion database to an Always On availability group by using SQL Server Management Studio
Verify that SQL Server and SQL Server Browser services are running :
Make sure the SQL Server and SQL Server Browser services are running at all times on the server hosting your SQL instance.
The following screenshots are an example using SQL EXPRESS edition. (Screenshots property of © 2016 Microsoft)
Make sure the SQL Server and SQL Server Browser services are running at all times on the server hosting your SQL instance.
- Right-click one of the services in Windows Services.
- Select the Properties menu item.
- Set the service's startup type to Automatic in the resulting popup, and click OK.
- Right-click the service and select Start, if the service is not already started.
Turn off the Windows firewall on the SQL Server :
- Check and disable Windows Firewall on the SQL Server.
- Check the firewall on Orion Server as well.
Third-party database connectivity tools :
You can also use third-party DB connectivity tools to check if you are able to reach out to the SQL server.
To quickly test a database connection, try the Database Connection String / Command / SQL Tester Utility:
- Quickly executes an sql command and displays the output in a grid.
- Provides exception information to help troubleshoot connection issues.
Further troubleshooting steps for isolating the issue :
- Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: ) (© 2006 - 2017 All rights reserved. SQLAuthority.com, available at http://blog.sqlauthority.com/, obtained on January 16th, 2017)
- Check the host file if you have ever changed it. Check your DNS configuration.
- Install SQL Studio Management Console on Orion Server.
Once Done, follow the instructions in the following post. Make sure you are able to connect to SQL Server using SQL Studio.
How to enable remote connections in SQL Server 2008?
(© 2016 Microsoft, available at https://blogs.msdn.microsoft.com, obtained on January 16, 2017)
Checking if the DNS for the vIP of the SQL Server HA pool is resolving:
- Open Command Prompt and try to ping the DNS of the vIP for the SQL Server. If the ping is giving timeouts then confirm the next point.
- Execute the following steps:
- Open ODBC Data Sources (64-bit) (C:\WINDOWS\system32\odbcad32.exe)
- On User DNS tab click Add
- Select the driver (SQL Server Native Client 11.0) and click Finish
- Put in the name (testdbconnection) and Server (DNS of the currently active SQL Server) and click Next
- Select With SQL Server authentication using a login ID and password entered by the user. Fill in the Login ID and Password (Use the credentials Orion is using to access the database) and click Next
- check the Change the default database to, checkmark and select the Orion database and click Next. If you are getting an error like the one below this step check the credentials used and try again.
- Click Next
- Click Test Data Source
- The result you should see,
- If the ping for DNS of vIP is failing but ODBC is successful please move forward for workaround and for solution.
Workaround:
***Create a backup of the original host file.***
Edit the host (C:\Windows\System32\drivers\etc\hosts) file by using the DNS for vIP and pointing to IP of currently active SQL Server. This will need to be done across the Orion environment, including HA pool members.
Solution:
Make sure that DNS server has a resolution for the DNS used for vIP. After these steps restart services on main Orion server.