Jan 20, 2012

What Do You Mean SQL Server Not Found?


This is a quick post about my last CU update on one of my SharePoint 2010 Farms.
This is one of the smaller farms I manage, only two WFE/APP servers and a SQL backend server.
I had one of the servers throw the following errors when running the Configuration Wizard.




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)




Failed to initiate the upgrade sequence. An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: 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) System.Data.SqlClient.SqlException: 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) 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) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) 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.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) 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.SharePoint.Utilities.SqlSession.OpenConnection() at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, Boolean retryForDeadLock) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command) at Microsoft.SharePoint.Upgrade.SPDatabaseSequence.GetVersion(SPDatabase database, Guid id, Version defaultVersion, SqlSession session, SPDatabaseSequence sequence) at Microsoft.SharePoint.Upgrade.SPManager.RemoveLastUpdatedProcessInformation(SqlConnectionStringBuilder scsbConfigurationDatabase) at Microsoft.SharePoint.Upgrade.SPManager.BootStrap(Guid sessionId, SPUpgradeOperationFlags flags) at Microsoft.SharePoint.PostSetupConfiguration.UpgradeBootstrapTask.Run() at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()




Now keep in mind that the 1st server ran the Config Wizard without any issues.
After poking around the event viewer and ULS I decided to run the Config Wizard one more time. The second time I noticed that the SQL Server name was in quotes and had a leading space between the first quotation mark and the first letter of the SQL server name.
I opened regedit on both servers and searched for the SQL server name and found that the DSN was incorrect. I changed it to have the correct DSN and rerun the Config Wizard. It ran without any issues.
For those who are interested, the DSN for the Config Database is located: HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB


I love SharePoint Administration…
I love SharePoint Administration…
I love SharePoint Administration…
I love SharePoint Administration…
I love SharePoint Administration…

2 comments:

  1. Thanks, Kyle - you saved me. I just installed the bits for SP2013 SP1 on a sandbox farm and while it took forever (5 hours) it finally completed. I was not able to complete the upgrade because of the same error you described. After checking all other possible issues with SQL Server and the domain account being used and reading all the other useless noise on the Net I finally came across your post. There WAS an embedded SPACE at the end on my server/instance name at HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB. I removed that space and rebooted Server 2012 just to be sure. The Upgrade completed as expected. NOTE that I had seen occasional errors in the event logs about my account not connecting to the SQL Server but everything was working just fine so I never pursued it any further. It finally caught up with me, though. Thanks a million.

    ReplyDelete
  2. Not sure if my previous comment made it in as the connect via G+ threw an error during the process so just to be sure I will do it again. Thanks so much Kyle for discovering this issue. I just upgraded my SP2013 sandbox to SP1 and ran into this issue trying to complete the upgrade. After checking all the usual suspects and reading all the noise on the Net and not finding any issues with connecting to SQL Server 2012 using the instance name I finally discovered a trailing space in the registry (under ..\15.0\Secure\ConfigDB). I updated that and rebooted just to be sure. The upgrade completed without issue after that. Thanks a million!

    ReplyDelete