Install-SitecoreConfiguration : Failed to start service Sitecore Marketing Automation Engine

I do not know if you are so lucky as I am … but every time when I am trying to install a new version of vanilla Sitecore on my local instance I have got issues which did not appear for other developers.

This time during installation of Sitecore 9.1 which should take 10-15 minutes I noticed that XP0-SingleDeveloper.ps1 script starts and stops more or less in the middle of whole installation process with following error: 

[---------------------------------- XConnectXP0_StartServices [2] : ManageService --------------------------------------------------]
[XConnectXP0_StartServices [2]]:[Updating] sc910.xconnect-MarketingAutomationService
Install-SitecoreConfiguration : Failed to start service 'Sitecore Marketing Automation Engine - sc910.xconnect-MarketingAutomationSer
vice (sc910.xconnect-MarketingAutomationService)'.
At C:\ResourceFiles\XP0-SingleDeveloper.ps1:74 char:1
+ Install-SitecoreConfiguration @singleDeveloperParams *>&1 | Tee-Objec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

[TIME] 00:04:07
Start-Service : Failed to start service 'Sitecore Marketing Automation Engine - sc910.xconnect-MarketingAutomationService (sc910.xcon
nect-MarketingAutomationService)'.
At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.0.0\Public\Tasks\Invoke-ManageServiceTask.ps1:40 char:33
+                     $instance | Start-Service
+                                 ~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommand
   Exception
    + FullyQualifiedErrorId : StartServiceFailed,Microsoft.PowerShell.Commands.StartServiceCommand

I spent few hours trying to fix that. Based on previous experiences with Sitecore 9 and issues which I had with certificates I checked if my xConnect is accessible from the browser – it wasn’t. So I knew why I saw that error. 

Usually, when I had an issue with certificates I had to just add those certificates to the trusted list with mmc tool (more details here) but not this time. 

I started to search for solution in the internet and found following articles: 

  • https://kamsar.net/index.php/2017/10/All-about-xConnect-Security/
  • https://sitecorecorner.com/2017/10/25/sitecore-9-xconnect-ssl-and-that-403-forbidden/
  • https://stackoverflow.com/questions/26247462/http-error-403-16-client-certificate-trust-issue

The third link has been mentioned in the second link as a solution. In my case, this didn’t help but suggested the solution.

Powershell scripts were moving certificates to Intermediate Certification Authorities category – in theory it should be enough … in my case didn’t change anything so I checked what I had in this directory. 

I found out that DO_NOT_TRUST_SitecoreRootCert was added there many times. That was signal to me that it seems to be an issue. I deleted all of them before I tried install Sitecore again. And it worked! 

Currently, after installation I have got just one SitecoreRootCert. 

No data in Application Insights for Sitecore instance?

It is a short article from the series “How is it possible that I missed that rows in the configuration?”

When we use Application Insights in Azure we usually have data about:

  • Logged errors
  • Failed Requests
  • Server response time
  • Server requests
  • etc

But in my instance, I had only information about logged errors and other warnings. My charts with data about requests were empty and it was looking in the following way:

I spent a few hours on searching for the solution. I tried solutions from StackOverflow but in my case, nothing worked.

So after another few hours of checking all the configs, I found out that the issue is a missing module from web.config file.

Rows responsible for adding data to Application Insights are:

<remove name="TelemetryCorrelationHttpModule" />			<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
			<remove name="ApplicationInsightsWebTracking" />			<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />

The bolded one (one which was missing in my configuration) is responsible for telemetry data like number or time of the requests.

The second one is responsible for the errors and logs added to the AI.

After that change, my data appears on the charts!