Today I am continuing yesterday's task of installing Sitecore 9 Update-2 with the installation of Sitecore Commerce (SxC) along with the default Storefront powered by Sitecore Accelerator (SxA). I have heard many horror stories about the difficulty of this install from my colleagues.
Updating the installation directory was pretty simple. I simply searched through all *.json file located under C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14 for "inetpub\\wwwroot" and changed to "projects\\Commerce92". It would be great if Sitecore could update the files to parameterize in the base installation directory.
Master_SingleServer.180724 (7).log
This error led me down the merry road of hacks and workarounds. I won't get into the details. Eventually I was saved by my colleague Thiago who had run into this exact issue and was able to help me. The issue pertains the version of Sql Server I am running version 13.0.4001.0. One thing I noticed, was when the script finished executing the command prompt would end up at "C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1", instead of remaining at the entry point of "C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14". This would cause problems later in the script, where SIF could not find source files to copy.
This looks like a minor point, but if you encounter this issue, look at "step 17 (optional)" from the article Step-by-step guide for Sitecore XC9 Update 1 installation on your machine . The SIF powershell module DeployCommerceDatabase.psm1 must be replaced with this one the author provides. The location of the file on my installation is C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14\Modules\DeployCommerceDatabase. Restart the Powershell Console for the changes to pick up.
First off, by the time I completed, this step was not absolutely necessary. But one warning, when re-zipping the Sitecore.Commerce.Engine.2.2.126 folder, be sure you do not add the folder name into the zip archive itself. This led me to having a Sitecore.Commerce.Engine.2.2.126.zip, with a top level folder of "Sitecore.Commerce.Engine.2.2.126". So when SIF attempts to unpack this folder the files are not in the correct position, and I ran into this problem that took me an hour to solve, simply because the file contents were being unpacked to the wrong directory:
CommerceEngine.Deploy.180724 (6).log
The author also warns that timeouts can happen during the final, and longest, phase of the script, rebuilding the indexes. Luckily I did not encounter that issue.
Base instructions
For instructions, I am following the Sitecore Commerce On Premises Installation Guide, but principally I am following this article Installing Sitecore Experience Commerce (SXC) 9.0 Update 2 (9.0.2). The author has provided an excellent step-by-step guide, as well as a powershell script to run the whole process.Working directory
There may be discrepancies between this article and the Installing Sitecore Experience Commerce article linked above in terms of file paths. Instead of locating my installation file and installation assets at C:\deploy and C:\deploy\assets, I am using C:\projects\Commerce92\Install\SxC, and C:\projects\Commerce92\Install\SxC\assets. Examples below will reflect that.
First Challenge
This first obstacle in running the SiF framework for Sitecore Commerce installation is I want to override the basic installation settings and install everything into my working directory C:\Projects\Commerce92, instead of installing the CommerceAuthoring, CommerceMinions, CommerceOps, CommerceShops, and SitecoreIdentityServer sites into the default location at C:\Inetpub\wwwroot. This is common practice here at SidLee, and it makes storing the entire installation in Git much simpler. I find it a good practice at an agency where any of us might be working on two or three different projects in a week.Updating the installation directory was pretty simple. I simply searched through all *.json file located under C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14 for "inetpub\\wwwroot" and changed to "projects\\Commerce92". It would be great if Sitecore could update the files to parameterize in the base installation directory.
Second Challenge
I was stuck on this error in the installation scripts
Master_SingleServer.180724 (7).log
[-------------------------------------------------------------------------------------------- DeployCommerceDatabase : DeployCommerceDatabase --------------------------------------------------------------------------------------------] Deleting existing CommerceServices databases... ********************** Command start time: 20180724135857 ********************** PS>TerminatingError(Add-PSSnapin): "An item with the same key has already been added." >> TerminatingError(Add-PSSnapin): "An item with the same key has already been added." >> TerminatingError(Add-PSSnapin): "An item with the same key has already been added." Install-SitecoreConfiguration : An item with the same key has already been added. At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21 + & $entry.Task.Command @paramSet | Out-Default + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration Install-SitecoreConfiguration : An item with the same key has already been added. At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21 + & $entry.Task.Command @paramSet | Out-Default + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration [TIME] 00:00:48 Transcript stopped, output file is C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14\CommerceEngine.Deploy.180724 (2).log ********************** Command start time: 20180724135857 ********************** PS>TerminatingError(Add-PSSnapin): "An item with the same key has already been added." Install-SitecoreConfiguration : An item with the same key has already been added. At C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14\sxc9u2-My-Deploy-Sitecore-Commerce.ps1:81 char:2 + Install-SitecoreConfiguration @params + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration Install-SitecoreConfiguration : An item with the same key has already been added. At C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14\sxc9u2-My-Deploy-Sitecore-Commerce.ps1:81 char:2 + Install-SitecoreConfiguration @params + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
This error led me down the merry road of hacks and workarounds. I won't get into the details. Eventually I was saved by my colleague Thiago who had run into this exact issue and was able to help me. The issue pertains the version of Sql Server I am running version 13.0.4001.0. One thing I noticed, was when the script finished executing the command prompt would end up at "C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1", instead of remaining at the entry point of "C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14". This would cause problems later in the script, where SIF could not find source files to copy.
This looks like a minor point, but if you encounter this issue, look at "step 17 (optional)" from the article Step-by-step guide for Sitecore XC9 Update 1 installation on your machine . The SIF powershell module DeployCommerceDatabase.psm1 must be replaced with this one the author provides. The location of the file on my installation is C:\projects\Commerce92\Install\SxC\SIF.Sitecore.Commerce.1.2.14\Modules\DeployCommerceDatabase. Restart the Powershell Console for the changes to pick up.
Third Challenge
The issue with Sql Server is the major remedy, but one other thing I want to point out, which is more my challenges with using 7-zip, but I will extend as a warning. In the directions I followed the author instructs to do the following:
– Unzip “C:\deploy\Sitecore.Commerce.Engine.2.2.126.zip” into “C:\deploy\Sitecore.Commerce.Engine.2.2.126” folder and open “C:\deploy\Sitecore.Commerce.Engine.2.2.126\wwwroot\bootstrap\Global.json” file. Set the “Database” value under “SourceStoreSqlPolicy” to “SitecoreCommerce9_Global” Set the “Server” value under “SourceStoreSqlPolicy” to “ Zip the folder “C:\deploy\Sitecore.Commerce.Engine.2.2.126” as “C:\deploy\Sitecore.Commerce.Engine.2.2.126.zip” file overwriting the existing file “C:\deploy\Sitecore.Commerce.Engine.2.2.126.zip”. Remove “C:\deploy\Sitecore.Commerce.Engine.2.2.126” folder afterwards
First off, by the time I completed, this step was not absolutely necessary. But one warning, when re-zipping the Sitecore.Commerce.Engine.2.2.126 folder, be sure you do not add the folder name into the zip archive itself. This led me to having a Sitecore.Commerce.Engine.2.2.126.zip, with a top level folder of "Sitecore.Commerce.Engine.2.2.126". So when SIF attempts to unpack this folder the files are not in the correct position, and I ran into this problem that took me an hour to solve, simply because the file contents were being unpacked to the wrong directory:
CommerceEngine.Deploy.180724 (6).log
[------------------------------------------------------------------------------------------ DeployCommerceContentOps : DeployCommerceContent ---------------------------------------------------------------------------------------------] Extracting CommerceServices from C:\projects\Commerce92\Install\SxC\Sitecore.Commerce.Engine.2.2.126.zip to C:\inetpub\wwwroot\CommerceOps_Commerce92 Commerce OpsApi Services extraction completed Creating Commerce Services logs directory at: C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\logs Directory: C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 7/24/2018 2:13 PM logs Granting full access to 'SLMTL-C1263\CSFndRuntimeUser' to logs directory: C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\logs Attempt 1 to set permissions GrantFullReadWriteAccessToFile ********************** Command start time: 20180724141304 ********************** PS>TerminatingError(Get-Content): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\config.json' because it does not exist." >> TerminatingError(Invoke-DeployCommerceContentTask): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\config.json' because it does not exist." >> TerminatingError(Invoke-DeployCommerceContentTask): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path 'C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\config.json' because it does not exist." Install-SitecoreConfiguration : Cannot find path 'C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\config.json' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21 + & $entry.Task.Command @paramSet | Out-Default + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration Install-SitecoreConfiguration : Cannot find path 'C:\inetpub\wwwroot\CommerceOps_Commerce92\wwwroot\config.json' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\1.2.1\Public\Install-SitecoreConfiguration.ps1:253 char:21 + & $entry.Task.Command @paramSet | Out-Default + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration
The author also warns that timeouts can happen during the final, and longest, phase of the script, rebuilding the indexes. Luckily I did not encounter that issue.
Comments
Post a Comment