Sitecore Commerce 10 Installation Error: Module-HabitatImages_InstallWDPModuleMaster : WebDeploy (Task 117 of 212)

This is another blog on Sitecore Commerce 10 Powershell installation error. This is the pattern to replicate this error - 

1. First, Install a Sitecore commerce instance

2. Then, Uninstall the instance. 

3. Again, try to re-install the instance with the same name as above 

As far as I checked, this error is thrown since the PS uninstall script doesn't cleanup entries in the database. After some analysis, realized that if running for the second time, I should skip the habitat and adventure works install wdp tasks (below) in \Sitecore.Commerce.WDP.2020.08-6.0.238\SIF.Sitecore.Commerce.5.0.49\Configuration\Commerce\Master_SingleServer.json, this error wouldn't be encountered:

"Module-HabitatImages": {

            "Source": ".\\Configuration\\Commerce\\Common\\Common.InstallWdpModule.json"

        },

"Module-AdventureWorksImages": {

            "Source": ".\\Configuration\\Commerce\\Common\\Common.InstallWdpModule.json"

        }

When I ran the install without these tasks, the installation was successful. I aim to accommodate this change - to run a cut-down list of tasks, in SCIA . Stay tuned!

Fixed and running Commerce Instance:





Original Error:




 Info: Adding database (data source=(local);initial catalog=scomm10sxa_Master;user id=sa)                                Info: Initializing deployment: Pending.                                                                                 Info: Analyzing deployment plan: Pending.                                                                               Info: Updating database: Pending.                                                                                       Info: Creating deployment plan: Pending.                                                                                Info: Verifying deployment plan: Pending.                                                                               Info: Deploying package to database: Pending.                                                                           Info: Creating deployment plan: Running.                                                                                Info: Initializing deployment: Running.                                                                                 Info: Initializing deployment (Start)                                                                                   Info: Initializing deployment: Completed.                                                                               Info: Initializing deployment (Complete)                                                                                Info: Creating deployment plan: Completed.                                                                              Info: Verifying deployment plan: Running.                                                                               Info: Analyzing deployment plan: Running.                                                                               Info: Analyzing deployment plan (Start)                                                                                 Info: Analyzing deployment plan: Completed.                                                                             Info: Analyzing deployment plan (Complete)                                                                              Info: Verifying deployment plan: Completed.                                                                             Info: Deploying package to database: Running.                                                                           Info: Updating database: Running.                                                                                       Info: Updating database (Start)                                                                                         msdeploy.exe : Error: .Net SqlClient Data Provider: Msg 8672, Level 16, State 1, Line 2 The MERGE statement attempted   to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A     MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a  target row matches at most one source row, or use the GROUP BY clause to group the source rows.                         At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.3.0\Public\Tasks\Invoke-CommandTask.ps1:31     char:13                                                                                                                 +             & $Path $Arguments | Out-Default                                                                          +             ~~~~~~~~~~~~~~~~~~                                                                                            + CategoryInfo          : NotSpecified: (Error: .Net Sql...he source rows.:String) [], RemoteException                  + FullyQualifiedErrorId : NativeCommandError                                                                                                                                                                                                Error: Script execution error.  The executed script:                                                                    BEGIN TRANSACTION;                                                                                                      CREATE TABLE #Blobs (                                                                                                       BlobId  UNIQUEIDENTIFIER NOT NULL,                                                                                      [Index] INT              NOT NULL,                                                                                      Data    IMAGE            NOT NULL,                                                                                      Created DATETIME         NOT NULL                                                                                   );                                                                                                                      CREATE TABLE #Items (                                                                                                       ID         UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,                                                                       Name       NVARCHAR (256)   COLLATE database_default NOT NULL,                                                          TemplateID UNIQUEIDENTIFIER NOT NULL,                                                                                   MasterID   UNIQUEIDENTIFIER NOT NULL,                                                                                   ParentID   UNIQUEIDENTIFIER NOT NULL,                                                                                   Created    DATETIME         NOT NULL,                                                                                   Updated    DATETIME         NOT NULL                                                                                );                                                                                                                      CREATE TABLE #SharedFields (                                                                                                ItemId  UNIQUEIDENTIFIER NOT NULL,                                                                                      FieldId UNIQUEIDENTIFIER NOT NULL,                                                                                      Value   NVARCHAR (MAX)   COLLATE database_default NOT NULL,                                                             Created DATETIME         NOT NULL,                                                                                      Updated DATETIME         NOT NULL,                                                                                      PRIMARY KEY CLUSTERED ([ItemID], [FieldID])                                                                         );                                                                                                                      CREATE TABLE #VersionedFields (                                                                                             ItemId   UNIQUEIDENTIFIER NOT NULL,                                                                                     FieldId  UNIQUEIDENTIFIER NOT NULL,                                                                                     Language NVARCHAR (                                                                                                 Info: An error occurred while the batch was being executed.                                                             Info: Updating database: Faulted.                                                                                       Info: Updating database (Failed)                                                                                        Info: Deploying package to database: Faulted.                                                                           Error Code: ERROR_EXECUTING_METHOD                                                                                      More Information: Could not deploy package.                                                                             Error SQL72014: .Net SqlClient Data Provider: Msg 8672, Level 16, State 1, Line 2 The MERGE statement attempted to      UPDATE or DELETE the same row more than once. This happens when a target row matches more than o                        ne source row. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON    clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.      Error SQL72045: Script execution error.  The executed script:                                                           BEGIN TRANSACTION;                                                                                                      CREATE TABLE #Blobs (                                                                                                       BlobId  UNIQUEIDENTIFIER NOT NULL,                                                                                      [Index] INT              NOT NULL,                                                                                      Data    IMAGE            NOT NULL,                                                                                      Created DATETIME         NOT NULL                                                                                   );                                                                                                                      CREATE TABLE #Items (                                                                                                       ID         UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,                                                                       Name       NVARCHAR (256)   COLLATE database_default NOT NULL,                                                          TemplateID UNIQUEIDENTIFIER NOT NULL,                                                                                   MasterID   UNIQUEIDENTIFIER NOT NULL,                                                                                   ParentID   UNIQUEIDENTIFIER NOT NULL,                                                                                   Created    DATETIME         NOT NULL,                                                                                   Updated    DATETIME         NOT NULL                                                                                );                                                                                                                      CREATE TABLE #SharedFields (                                                                                                ItemId  UNIQUEIDENTIFIER NOT NULL,                                                                                      FieldId UNIQUEIDENTIFIER NOT NULL,                                                                                      Value   NVARCHAR (MAX)   COLLATE database_default NOT NULL,                                                             Created DATETIME         NOT NULL,                                                                                      Updated DATETIME         NOT NULL,                                                                                      PRIMARY KEY CLUSTERED ([ItemID], [FieldID])                                                                         );                                                                                                                      CREATE TABLE #VersionedFields (                                                                                             ItemId   UNIQUEIDENTIFIER NOT NULL,                                                                                     FieldId  UNIQUEIDENTIFIER NOT NULL,                                                                                     Language NVARCHAR (                                                                                                   Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_METHOD.                                 Error: Could not deploy package.                                                                                        Error SQL72014: .Net SqlClient Data Provider: Msg 8672, Level 16, State 1, Line 2 The MERGE statement attempted to      UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source r             ow. A MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to

ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.

Error SQL72045: Script execution error.  The executed script:

BEGIN TRANSACTION;

CREATE TABLE #Blobs (

    BlobId  UNIQUEIDENTIFIER NOT NULL,

    [Index] INT              NOT NULL,

    Data    IMAGE            NOT NULL,

    Created DATETIME         NOT NULL

);

CREATE TABLE #Items (

    ID         UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,

    Name       NVARCHAR (256)   COLLATE database_default NOT NULL,

    TemplateID UNIQUEIDENTIFIER NOT NULL,

    MasterID   UNIQUEIDENTIFIER NOT NULL,

    ParentID   UNIQUEIDENTIFIER NOT NULL,

    Created    DATETIME         NOT NULL,

    Updated    DATETIME         NOT NULL

);

CREATE TABLE #SharedFields (

    ItemId  UNIQUEIDENTIFIER NOT NULL,

    FieldId UNIQUEIDENTIFIER NOT NULL,

    Value   NVARCHAR (MAX)   COLLATE database_default NOT NULL,

    Created DATETIME         NOT NULL,

    Updated DATETIME         NOT NULL,

    PRIMARY KEY CLUSTERED ([ItemID], [FieldID])

);

CREATE TABLE #VersionedFields (

    ItemId   UNIQUEIDENTIFIER NOT NULL,

    FieldId  UNIQUEIDENTIFIER NOT NULL,

    Language NVARCHAR (

Error count: 1.

Install-SitecoreConfiguration : Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero

exit code - (-1)

At C:\sitecore\SCIA\SIF.Sitecore.Commerce.5.0.49\scomm10sxasc.dev.local_Install_Script.ps1:290 char:2

+     Install-SitecoreConfiguration @deployCommerceParams -Verbose *>&1 ...

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration


[TIME] 00:21:24

Invoke-CommandTask : Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code -

(-1)

At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.3.0\Public\Tasks\Invoke-WebDeployTask.ps1:36

char:2

+     Invoke-CommandTask -Path $Path -Arguments $msdeployArgs -TaskName ...

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CommandTask

Comments

Popular Posts