So this is how it began, the biggest adventure of our lives, working on installing Sitecore Commerce 8.2.1 on a fresh copy of Windows 10 with the latest update – “Fall Creators Update (1709)”.
After following the official Sitecore Commerce 8.2.1 Deployment Guide in every detail, we ended up getting this below error before proceeding to the “Deploy the Commerce Engine” step, just after we’ve executed the Initialize-CSSite command and we’ve configured the role-based permissions for each Web Service identity.
The error
[CommerceProfileSystemException: Failed to initialize profile service handle.]
Error HRESULT E_FAIL has been returned from a call to a COM component.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]
CommerceServer.Core.Interop.Profiles.ProfileServiceClass.Initialize(String sConfigStore, String sCatalog) +0
CommerceServer.Core.Runtime.Profiles.ProfileContext..ctor(String profileServiceConnectionString, String providerConnectionString, String bdaoConnectionString, DebugContext debugContext) +808
[CommerceProfileSystemException: Failed to initialize profile service handle.]
CommerceServer.Core.Runtime.Profiles.ProfileContext..ctor(String profileServiceConnectionString, String providerConnectionString, String bdaoConnectionString, DebugContext debugContext) +1385
CommerceServer.Core.Runtime.CommerceContextFactory.CreateProfileContext() +939 CommerceServer.Core.Runtime.CommerceContextFactory.get_ProfileContextSingleton() +116 CommerceServer.Core.Runtime.Profiles.CommerceProfileModule.get_ModuleProfileContext() +129 CommerceServer.Core.Runtime.Profiles.CommerceProfileModule.get_ProfileContext() +178 Sitecore.Commerce.Connect.CommerceServer.Pipelines.CommerceProfileProcessor.Begin(CommerceProfileModule module) +25
Sitecore.Commerce.Connect.CommerceServer.Pipelines.CommerceBaseModuleProcessor1.BeginRequest(PipelineArgs
args) +92
The investigation process
Looking at the error it seems there is a problem connecting to the SQL server,so we’ve started checking the connections string the settings defined in the Sitecore Commerce Management. Everything looked fine.
Then the adventure began, brainstorming and trying to figure it out:
- Made sure we have a local admin user named CSFndRuntimeUser and the APP Pools use this identity: “.\CSFndRuntimeUser”
- Checked and double checked the connection strings in Commerce Server Manager:
– Commerce Server Manager (root node)
– Global Resources / Profiles (my profile) -> all 3 conn strings
– Global Resources / Profiles / Profile Catalog / Data Sources / ProfileService_SQLSouce / Partitions
- Turned on the Auditing Log in Windows to see if there are any auditing failures when the problem occurs – nothing
- Disabled all antivirus and firewall software to make sure the connection is not blocked by them
- Made sure the ProfilesWebServices are reachable: http://localhost:1004/XXX_ProfilesWebService/ProfilesWebService.asmx
- Made sure we are running the website under https locally and we’ve configured the certificates correctly
- Reinstalled SQL Server and made sure the user used has permissions to the databases
How we’ve fixed it – we’ve rolled back the Windows Update
After a week of struggling around and trying everything to bypass this error, we’ve decided to install a Virtual Machine with the previous version of Windows 10 – not including the “Fall Creators Update”. Everything worked like a charm, following the exact same steps. Some other Sitecorians were having the same issue while using the Windows 10 “Fall Creators Update” and unfortunatelly we did not get to the bottom of the issue yet.
Update 15 Dec 2017: Sitecore released a Hotfix
You can download hotfix here and follow the instruction in the article below. Fingers crossed!
Special thanks to the Sitecore Community that was very responsive on the #ecommerce Sitecore Slack channel