StoreFront-PreconfigureInstance_CopySiteUtilityFolder : Copy: Install-SitecoreConfiguration : Cannot validate argument on parameter 'Source'. The " Test-Path $_ " validation script for the argument with value

Error:
StoreFront-PreconfigureInstance_CopySiteUtilityFolder : Copy

Install-SitecoreConfiguration : Cannot validate argument on parameter 'Source'. The " Test-Path $_ " validation script
for the argument with value
"C:\deploy\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28\SiteUtilityPages" did not return a
result of True. Determine why the validation script failed, and then try the command again.
At C:\deploy\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28\My-SC9-XC-Deploy-Sitecore-Commerce -
Inst2.ps1:93 char:1
+ Install-SitecoreConfiguration @params -Verbose *>&1 | Tee-Object "$PS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration

[TIME] 00:03:34
Invoke-CopyTask : Cannot validate argument on parameter 'Source'. The " Test-Path $_ " validation script for the
argument with value "C:\deploy\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28\SiteUtilityPages"
did not return a result of True. Determine why the validation script failed, and then try the command again.
At C:\Users\abc\Documents\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Install-SitecoreConfiguration
.ps1:641 char:47
+                         & $entry.Task.Command @paramSet | Out-Default
+                                               ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Invoke-CopyTask], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Invoke-CopyTask

Solution: Based on the Sitecore Commerce 9.2 JSON File Invocation Flow and Sitecore Commerce 9.2 Install: JSON - Task Dependency List (On-prem / Solr), since this error happens in CopySiteUtilityFolder task in  SXAStorefront.Preconfigure.json, found that the  SiteUtilityPages folder is missing (from <deploy files unzip folder>\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28) and was probably removed by a prior Sitecore Commerce installation. So, copy over just the SiteUtilityPages  folder from SIF.Sitecore.Commerce.3.0.28.zip under Sitecore.Commerce.WDP.2019.07-4.0.165.zip to <deploy files unzip folder>\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28 folder (in my case, c:\deploy\Sitecore.Commerce.WDP.2019.07-4.0.165\SIF.Sitecore.Commerce.3.0.28).
Then, restart installation to see the error is fixed now.



Comments