SQL SERVER – FIX: Install Error: A Network-Related or Instance-Specific Error Occurred While Establishing a Connection to SQL Server

SQL SERVER - FIX: Install Error: A Network-Related or Instance-Specific Error Occurred While Establishing a Connection to SQL Server xerror One of the most common connectivity errors which I have heard about it is “A network-related or instance-specific error occurred while establishing a connection to SQL Server.” In this blog, we would learn about how to fix this error if it comes during the installation of SQL Server.

THE SITUATION

If you search for the error which I mentioned in blog subject, one of my blogs which would come up is the following SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

There are many other on the internet which would have any suggestions to fix the error.

Solarwinds

The situation here is a little different than all the others. My client was getting this error during the installation of SQL Server. So, this was not in any client application, website or SQL Server Management Studio, but seen in installation logs. The following information is picked from “Detail.txt” file, which is one of the most important files, used to fix issues related to installation.

SQLEngine: –SqlDatabaseServiceConfig: Connection String: Data Source=\\.\pipe\SQLLocal\MSSQLSERVER;Initial Catalog=master;Integrated Security=True;Pooling=False;Connect Timeout=300;Network Library=dbnmpntw;Application Name=SqlSetup
SQLEngine: : Checking Engine checkpoint ‘ServiceConfigConnect’
SQLEngine: –SqlDatabaseServiceConfig: Connecting to SQL….
Sco: Attempting to connect script
Connection string: Data Source=\\.\pipe\SQLLocal\MSSQLSERVER;Initial Catalog=master;Integrated Security=True;Pooling=False;Connect Timeout=300;Network Library=dbnmpntw;Application Name=SqlSetup
Sco: Connection error code from SqlException is : 2
Prompting user if they want to retry this action due to the following failure:
—————————————-
The following is an exception stack listing the exceptions in outermost to innermost order
Inner exceptions are being indented
Exception type: Microsoft.SqlServer.Configuration.Sco.ScoException
Message:
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)
HResult : 0x84bb0001
FacilityCode : 1211 (4bb)
ErrorCode : 1 (0001)
Data:
DisableRetry = true
Inner exception type: System.Data.SqlClient.SqlException
Message:
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)
HResult : 0x80131904
Data:
HelpLink.ProdName = Microsoft SQL Server
HelpLink.EvtSrc = MSSQLServer
HelpLink.EvtID = 2
HelpLink.BaseHelpUrl = http://go.microsoft.com/fwlink
HelpLink.LinkId = 20476
Stack:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Configuration.Sco.SqlScriptExecution.GetConnection()
at Microsoft.SqlServer.Configuration.Sco.SqlScriptExecution.Connect()

WORKAROUND/SOLUTION

After doing a lot of investigation, I found that this was due to TLS settings. My client was installing SQL Server 2014 RTM version which it doesn’t support TLS 1.2.

We uninstalled everything and disabled TLS 1.2 and enabled TLS 1.0

Here are the steps:

  1. Enable TLS 1.0 on the server. by following below KB article.TLS 1.2 support for Microsoft SQL Server
  2. Restart the server.
  3. Install SQL Server 2014 and patch to latest version.
  4. Disable TLS 1.0.
  5. Restart the server.

After this, the SQL was installed, and the application was able to connect to SQL Server.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
, ,
Previous Post
SQL SERVER – Script Level Upgrade for Database ‘master’ Failed Because Upgrade Step ‘SSIS_hotfix_install.sql’ Encountered Error 15151
Next Post
SQL SERVER – Error: 9642 – An error occurred in a Service Broker/Database Mirroring transport connection endpoint

Related Posts

Leave a Reply

Menu