Monday, June 26, 2023

Sitecore installation : Failed to start the Marketing Automation Engine service

 Sitecore installation : Failed to start the Marketing Automation Engine service

This blog is intended to demo the resolution of common issues while installing Sitecore at the step where the setup errors out failing to start the Marketing Automation Service. I have experienced this issue while installing multiple versions of Sitecore where the setup starts failing at the step of starting the service Sitecore Marketing Automation Engine.
Sitecore XConnect certificate error – HTTP response was not successful: Forbidden




After digging into the logs of the Marketing Engine job, I was able to identify the root cause of the setup failure.

ERROR Exception when executing agent aggregation/aggregator Exception: Sitecore.XConnect.XdbCollectionUnavailableException Message: The HTTP response was not successful: Forbidden Source: Sitecore.Xdb.Common.Web at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory) at Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock(Func`1 taskFactory) at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.Initialize(XmlNode configNode) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient(String clientConfigPath) at Sitecore.Analytics.Aggregation.XConnect.DefaultXdbContextFactory.CreateReadOnly() at Sitecore.Analytics.Processing.AsyncPoolScheduler`2..ctor(IAsyncProcessingPool`1 pool, IXdbContextFactory xdbContextFactory, ExpandOptions options, Int16 maxBatchSize, BaseLog log) at Sitecore.Analytics.Aggregation.InteractionAggregationAgent.<ExecuteCoreAsync>d__15.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.Analytics.Core.Agent.<ExecuteAsync>d__1.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.Analytics.Core.AsyncBackgroundService.<ExecuteAgentAsync>d__22.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Sitecore.Analytics.Core.AsyncBackgroundService.<RunAsync>d__26.MoveNext()



Here are some of the ways you can fix this issue, depending on the situation.

First way is to identify if there are any non-self-signed certificates in the Trusted root store. Below is the PS script to identify it:
1
Get-Childitem cert:\LocalMachine\root -Recurse | Where-Object {$_.Issuer -ne $_.Subject}
If there are any certificates found after running the previous script, please run the below script to move them to the Intermediate Certification Authorities:

Get-Childitem cert:\LocalMachine\root -Recurse | Where-Object {$_.Issuer -ne $_.Subject} | Move-Item -Destination Cert:\LocalMachine\CA


Another way to fix the above issue is to “Disable TLS 1.3 over TCP”.

To get to the settings,

Open IIS -> Go to the xConnect site-> Click on Bindings -> Open the https binding and check the setting “Disable TLS 1.3 over TCP”.





If still the issue doesn’t get fixed by this, there could be other issues happening. I was able to resolve the issue by fixing the permissions on the relevant folders. Make sure the wwwroot folder/website folder are required


a. IUSR-> Full Access
b. Network Service -> Full Access
c. IIS_IUSERS -> Full Access
d. LOCAL SERVICE -> Full access

You can also grant AppPools access to the wwwroot folder by granting Full Access to the IIS AppPool\xConnectAppPool





Sitecore installation issue : The certificate chain was issued by an authority that is not trusted

 

Sitecore installation issue : The certificate chain was issued by an authority that is not trusted


While installing Sitecore 10.x, there is a high change we encounter this issue specially on Windows 11.

The certificate chain was issued by an authority that is not trusted.


After doing some investigation I found that the setting we will require to add the setting “TrustServerCertificate” : true in the following places in the installation JSON files:

xconnect-xp0.json
a. CreateShardApplicationDatabaseServerLoginInvokeSqlCmd

b. CreateShardManagerApplicationDatabaseUserInvokeSqlCmd

c. CreateShard0ApplicationDatabaseUserInvokeSqlCmd

d. CreateShard1ApplicationDatabaseUserInvokeSqlCmd

sitecore-XP0.json

a. AddSqlDatabasesToElasticPool

Here are the snapshots of the sections of the file xconnect-xp0.json

a. CreateShardApplicationDatabaseServerLoginInvokeSqlCmd




b. CreateShardManagerApplicationDatabaseUserInvokeSqlCmd




c. CreateShard0ApplicationDatabaseUserInvokeSqlCmd



d. CreateShard1ApplicationDatabaseUserInvokeSqlCmd



Here is the snapshot of the section of the file sitecore-XP0.json

a. AddSqlDatabasesToElasticPool