7

We have recently upgraded Sitecore from 9.0.1 to 9.0.2

Sitecore website works fine, but checked xconnect logs - lots of exceptions like

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 (0x80131904): 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.ComponentModel.Win32Exception (0x80004005): The network path was not found
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.ShardMap.<OpenConnectionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Xdb.Collection.Data.SqlServer.Configuration.ElasticScaleConnectionManager.<>c__DisplayClass29_0.<<OpenConnectionAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.Xdb.Collection.Data.SqlServer.Configuration.ElasticScaleConnectionManager.<OpenConnectionAsync>d__29.MoveNext()

I can confirm that my collectionuser is properly setup in SQL server and has all required permissions, I can connect to Shard manager database with this user in SQL management studio. Also tried to connect from the server running xconnect with a power-shell script using same connection string.

I double checked connection strings - they are identical between sitecore website and xconnect (including index worker and marketing automation serviecs). And Sitecore website works just fine with those.

Sitecore website and xconnect are running on the same web server.

Index worker windows service is also throwing same errors.

What could be wrong here?

5
  • The are individual connection string files in the xconnect folder. I would search for sub folders and verify the connection strings. Sorry not at my compy to give you the relative path for them. Commented Jul 25, 2018 at 15:29
  • 1
    I know about 3: - xconnect\App_Config\ConnectionStrings.config - xconnect\App_data\jobs\continuous\AutomationEngine\App_Config\ConnectionStrings.config - xconnect\App_data\jobs\continuous\IndexWorker\App_config\ConnectionStrings.config and they all correct Commented Jul 25, 2018 at 16:49
  • 1
    Check the [__ShardManagement].[ShardsGlobal] table of the ShardMapManager database. There is a ServerName column in this table that is used to connect to the shards.
    – Jonne Kats
    Commented Jul 26, 2018 at 7:00
  • Could you double check if SQL prerequisites are in place as shown in this video (youtube.com/watch?v=-pMH7mcAVHg)? 1. Use "Sql Server and Windows Authentication Mode" 2. Use "contained database authentication"
    – grg
    Commented Jul 26, 2018 at 7:00
  • @JonneKats, you were right, we launched new DB instance with more RAM on it for the upgrade and that was the issue - I had to update ServerName column with our new IP and it all works now! thanks a lot. And by the way it looks to me as a poor design by saving server name in the database... Can you write an answer as "answer" and I will mark it as correct one. Commented Jul 26, 2018 at 8:07

1 Answer 1

16

The shard manager also keeps connection configuration in the [__ShardManagement].[ShardsGlobal] table of the ShardMapManager database. There is a ServerName, Port and DatabasName in there, so make sure these also point to the correct SQL server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.