Sitecore 9 Ecommerce installation errors

In this blog, I will discuss some of the errors and its possible solutions while installing sitecore commerce on web site with Sitecore 9.0 update 2.Note: The Sitecore version used for writing this blog is Sitecore 9.0 update 2 and Sitecore commerce module using SIF.Error 1You must remove all users with password before setting the containment property to NONEInstall-SitecoreConfiguration : Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1)At C:\Install\Sitecore9.1\Install.ps1:42 char:1+ Install-SitecoreConfiguration Solution/Fix Remove all the databases associated with the current installation instance. For example, sitecore adds databases with the name ecommerce if prefix attribute in PowerShell is ecommerce.SO removing all the databases in SQL with prefix ‘ecommerce’ will solve the error.Error 2Install-SitecoreConfiguration : Cannot bind argument to parameter 'CommerceEngineDacPac' because it is null.At C:\sc902commercedeploy\SIF.Sitecore.Commerce.1.2.14\Deploy-Sitecore-Commerce.ps1:80 char:32+     Install-SitecoreConfiguration @params+                                   ~~~~~~~    + CategoryInfo          : InvalidData: (:) [Install-SitecoreConfiguration], ParameterBindingValidationException    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Install-SitecoreConfigurationSolution Provide the CommerceEngineDacPac in the script to the correct pathCommerceEngineDacPac = "C:\sc902commercedeploy\Sitecore.Commerce.Engine.SDK.2.2.72\Sitecore.Commerce.Engine.DB.dacpac"               Install-SitecoreConfiguration : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter'SitecoreBizFxServicesContentPath'. Specified method is not supported.At C:\sc902commercedeploy\SIF.Sitecore.Commerce.1.2.14\Deploy-Sitecore-Commerce.ps1:80 char:32+     Install-SitecoreConfiguration @params+                                   ~~~~~~~    + CategoryInfo          : InvalidArgument: (:) [Install-SitecoreConfiguration], ParameterBindingException    + FullyQualifiedErrorId : CannotConvertArgument,Install-SitecoreConfiguration Solution/Fix– provide the correct path to the script to ‘CommerceEngineDacPac’ in params of powershell script.Error 3One or more exceptions occurred while processing the subscribers to the 'item:saved' event.body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } @media screen and (max-width: 639px) {  pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; } } @media screen and (max-width: 479px) {  pre { width: 280px; } }Solution/FixI have manually added “Sitecore Commerce ExperienceAnalytics Core 11.2.83.zip” package in sitecore console and got an error in installing item "/sitecore/system/Marketing Control Panel/Experience Analytics/Dimensions/Connect/By campaigns for orders placed/All campaigns for orders placed" which is because it gives an error ‘One or more exceptions occurred while processing the subscribers to the 'item:saved' event’.The reason is xConnect does not work.There are two solutions for this problem.

  1. Make sure the xConnect site works with SSL(https).
  2. If xConnect site does not work, alternative solution to bypass the above error is to comment out the item:saved event.

To do so, perform the following

  1. Navigate to the web site path “\App_Config\Sitecore\ExperienceAnalytics\Sitecore.ExperienceAnalytics.Client.config”.
  2. Open the file and find the following xml configuration section
  3. Comment out the above section and Rerun the “Deploy-Sitecore-Commerce.ps1” to add commerce module again.

<event name="item:saved">

<handler type="Sitecore.ExperienceAnalytics.Client.Deployment.Events.SegmentDeployedEventHandler, Sitecore.ExperienceAnalytics.Client" method="OnItemSaved">

<param

type="Sitecore.ExperienceAnalytics.Client.Deployment.DeploySegmentDefinitionProcessor, Sitecore.ExperienceAnalytics.Client">

<param ref="experienceAnalytics/client/logger" />

<param type="Sitecore.ExperienceAnalytics.Core.Repositories.ReferenceData.ReferenceDataSegmentStore, Sitecore.ExperienceAnalytics.Core">

</param>

</param>

</handler>

</event>

Error 4Install-SitecoreConfiguration : The service cannot accept control messages at this time. (Exception from HRESULT:0x80070425)At C:\ProgramFiles\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-Default+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfigurationSolution/FixReason is the app pool of the site is stopped. Go To computer management and make sure Site and the app pool of the web site are running.Error 5Install-SitecoreConfiguration : Could not load file or assembly 'file:///C:\sc902commercedeploy\assets\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web\Microsoft.Web.XmlTransform.dll' or one of its dependencies. Operation is not supported.(Exception from HRESULT: 0x80131515)At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-Default+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfigurationSolution/Fix

  • Navigate to “C:\sc902commercedeploy\assets\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web”.
  • Right click on “Microsoft.Web.XmlTransform.dll” file to open the properties to see the windows like shown below
  • Check Unblock checkbox and click apply.My machine is Widnows 10.Other servers may need to navigate differently.

Error 6Database 'sitecommerce_Master' is being recovered. Waiting until recovery is finished.Solution/FixThere are 2 solutions.

  1. Re run the installation wizard after 5 or more minutes
  2. If the problem still exists, set the auto close option on the database to be false. By default, it is set to ‘true’.This will lead into another timeout error so consider incresing timeout of SQL. 

 Error 7 Message: One or more local models conflict with the xDB service layer. 'RegisterConnectEventModel, 0.1' does not have a remote versionSource: Sitecore.Xdb.Common.Web   at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory) Solution/Fix

  1. Copy the file: \inetpub\wwwroot\<siteName>\XConnectModels\Sitecore.Commerce.Connect.XConnect.Models.json and Paste it to two locations to overwrite:
  • C:\inetpub\wwwroot\<siteName>.xconnect\App_data\jobs\continuous\IndexWorker\App_data\Models
  • C:\inetpub\wwwroot\<siteName>.xconnect\App_data\Mode

2.  Perform IISreset and run the script again. Error 8Get Token From Sitecore.IdentityServer**********************Command start time: 20180911222018**********************PS>TerminatingError(Invoke-RestMethod): "The remote server returned an error: (500) Internal Server Error.">> TerminatingError(Invoke-RestMethod): "The remote server returned an error: (500) Internal Server Error."Install-SitecoreConfiguration : The remote server returned an error: (500) Internal Server Error.At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-DefaultSolution/FixThis error is database connection error. We need to give user name and password to connection string in Sitecore Identity server web site.To do this

  1. navigate to C:\inetpub\wwwroot\SitecoreIdentityServer\wwwroot\appsettings.json
  2. Change the connection string and remove Integrated Security=True and provide user name and password.
  3. Make sure Initial Catalog exists in database.In my case , intial Catalog added local.sitecorecommerce_Core and I needed to remove (local.) Before as my database name is sitecorecommerce_Core in SQL.
  4. Perform IIS RESET and run the script again.

Error 9Using the SQL Server 2012 or 2014 Powershell Module.WARNING: SitecoreCommerce9_SharedEnvironments does not exist, cannot deleteWARNING: SitecoreCommerce9_Global does not exist, cannot deleteCreating CommerceServices databases...Importing DACPAC C:\sc902commercedeploy\Sitecore.Commerce.Engine.SDK.2.2.72\Sitecore.Commerce.Engine.DB.dacpacUsing SQL Server 140 to import DACPACSystem.ArgumentException: Cannot subscribe to the specified event. A subscriber with the source identifier 'msg' already exists.Invoke-DeployCommerceDatabaseTask : Cannot subscribe to the specified event. A subscriber with the source identifier 'msg' alreadyAt C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-Default+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-DeployCommerceDatabaseTaskSolution/FixEven if we get this error, sitecore commerce does not skip executing the PowerShell script but it will throw error eventually as this error message will stop creating the databases ‘SitecoreCommerce9_SharedEnvironments’ and ‘SitecoreCommerce9_Global’.To fix the error, In the same session of PowerShell ,unregister the event with name ‘msg’ by using the following command in PowerShell session itself.Get-EventSubscriber -SourceIdentifier "msg" | Unregister-EventError 10BootStrapping Commerce Services: https://localhost:5005/commerceops/Bootstrap() BearerInstall-SitecoreConfiguration : The remote server returned an error: (401) Unauthorized.At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-Default+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfigurationSolutionCheck if there is any connection problem to database. This error occurs when there is problem in connecting to database ‘SitecoreCommerce9_Global’.I ignored the previous error ‘Cannot subscribe to the specified event. A subscriber with the source identifier 'msg' already exists.’ Which is why the databases SitecoreCommerce9_SharedEnvironments’ and ‘SitecoreCommerce9_Global’ are not installed on my local machine.Make sure the database ‘SitecoreCommerce9_Global’’ is created in SQL server. Error 11Install-SitecoreConfiguration : Parameter 'PhysicalPath' should point to existing path.At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.1.0\Public\Install-SitecoreConfiguration.ps1:253 char:21+                     & $entry.Task.Command @paramSet | Out-Default+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfigurationSolution/FixMake sure the following path in Deploy-Sitecore-Commerce.ps1  points to unzipped version of Sitecore.BizFX folder rather than mistakenly point to the zip folder.SitecoreBizFxServicesContentPath = "C:\sc9_com_install-singleserver\Sitecore.BizFX.1.2.19" Referenceshttp://commercesdn.sitecore.net/SitecoreXC_9.0/Developers-Guide/Sitecore-XC-9.0_Developers_Guide.pdfhttps://community.sitecore.net/developers/f/6/t/9568#pi214filter=all&pi214scroll=falsehttps://naveed-ahmad.com/2018/02/25/sitecore-experience-commerce-xc9-troubleshooting-your-installation/https://buoctrenmay.com/2018/03/09/step-by-step-guide-for-sitecore-commerce-9-installation-on-your-machine/