0

I am getting below exception when running Heartbeat.aspx in Sitecore 10

41264 21:20:57 FATAL SINGLE MSG: Sitecore heartbeat: 
Exception: System.Exception
Message: Cannot access database defined by "core" connection string.

Nested Exception

Exception: System.Data.SqlClient.SqlException
Message: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Source: .Net SqlClient Data Provider
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Sitecore.Web.Services.Heartbeat.HeartbeatHelper.CheckDatabase(String connectionString)
   at Sitecore.Web.Services.Heartbeat.HeartbeatHelper.CheckDatabases(BeatResults results)

Nested Exception

Exception: System.ComponentModel.Win32Exception
Message: The wait operation timed out

Not sure why it is happening. Any help is appreciated.

2
  • Do you have a core DB in this environment or is this a CD environment without connection to core database? – Jeroen Nov 12 '20 at 17:50
  • It is just a setup on local machine and all database are store in local SQL server. – Shri Nov 13 '20 at 11:05
0

When Heartbeat.aspx page is opened, Sitecore goes through all the connection strings which are defined in connectionStrings.config file.

For each of them, it tries to connect to the database, to make sure that the connection string is valid.

If you see that log entry, it simply means that in your connection strings file is defined invalid connection string for core database.

Check whether that connection string is there and if it has correct value. Or even if it's needed.

2
  • I just checked the core user credentials in connectionstring config and tried to connect the core database using that credential through SSMS and was successful. – Shri Nov 13 '20 at 11:07
  • Does your site work? Or it doesn't start? Check if the TCP/IP protocol in SQL Server is enabled. The fact that you can access SQL Server from SSMS doesn't mean that Sitecore can connect. – Marek Musielak Nov 13 '20 at 12:23
0

@Marek has mentioned correctly. Heartbeat.aspx goes through all the connection strings mentioned in the ConnectionString.config file. It throws 500 issue if anyone of the connection string mentioned in the ConnectionString.config file is not valid.

ConnectionString.config file has lots of connection string. It has all the connection strings for all the databases. It also has connection strings which are not related to the database. Hence, connection check will never be succcessful. For example: solr.search, sitecore.reporting.client, EXM.CryptographicKey etc.

That's why whenever we run Sitecore Hearbeat page (https://sc100.sc/sitecore/service/Heartbeat.aspx), it always throw error.

To fix this issue, we have to tell the Sitecore that which all connection strings are not require check while checking heartbeat. For this we should use following setting:

<setting name="Sitecore.Services.Heartbeat.ExcludeConnection" value="LocalSqlServer" />

We should add all the connection string pipe seperated where that we don't want to check while performing heartbeat check:

<settings> <setting name="Sitecore.Services.Heartbeat.ExcludeConnection" value="LocalSqlServer|sitecore.reporting.client|sitecore.reporting.client.certificate|solr.search|sitecoreidentity.secret|xconnect.collection|xconnect.collection.certificate|xdb.marketingautomation.operations.client|xdb.marketingautomation.operations.client.certificate|xdb.marketingautomation.reporting.client|xdb.marketingautomation.reporting.client.certificate|xdb.referencedata.client|xdb.referencedata.client.certificate|EXM.CryptographicKey|EXM.AuthenticationKey|PackageManagementServiceUrl|sitecore.reporting.client|cloud.search" /> </settings>

This will fix your problem.

So create a patch file having the above mentioned setting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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