"An item with the same key has already been added" error on Package and Deployment - a View fails to deploy

  • 24 February 2022
  • 0 replies
  • 86 views

Userlevel 5
Badge +20
 

"An item with the same key has already been added" error on Package and Deployment - a View fails to deploy

kbt144167

PRODUCT
K2 blackpearl 4.7
BASED ON
K2 blackpearl 4.7
TAGS
Deployment
Cumulative Update
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

When deploying a package on your 4.7 environment through P&D, one of the Views fails to deploy with the error below returned:

 

"An item with the same key has already been added"

Symptoms

  • From the deployment logs, the full error message is as follows:-

 

"Fail <View Name> An item with the same key has already been added. System.ArgumentException: An item with the same key has already been added. at SourceCode.Hosting.Client.BaseAPI.BaseAPIConnection.RemoteCall(String TypeName, String MethodName, Object[] Parameters, Boolean[] NullList, MarshalMessageType CallType) at SourceCode.Hosting.Client.BaseAPI.BaseAPI.RemoteSessionCall(String TypeName, String MethodName, Object[] Parameters, Boolean[] NullList) at SourceCode.Forms.Management.FormsManager.DoSessionCall(String method, Object[] parameters, Boolean[] nullList) 2. Deleting the View and its dependencies on the Target environment, and then re-deploying the package does not help. at SourceCode.Forms.Management.FormsManager.Deploy(String definition, String category, Boolean checkIn, Boolean skipReferenceValidation) at SourceCode.Runtime.Services.Forms.FormsSessionData.DeployView(View view, Boolean checkIn, Boolean skipReferenceValidation) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.DeployAuthoringInstance(AuthoringType instance) at SourceCode.Runtime.Services.Forms.Services.BaseFormViewService`3.Deploy(IDeploymentContext context)"
 
  • The issue persists after deleting the erroneous View along with its dependencies on the Target environment, and then re-deploying the package.

Troubleshooting Steps

To resolve the issue, please apply the latest available 4.7 Cumulative Update which can be downloaded here.

0 replies

Be the first to reply!

Reply