"An item with the same key has been added" error appears when trying to access Domains in K2 Management

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.
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.


You might receive the following error when trying to access Domains in K2 Management:

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



- This issue is related to the HostServer.SecurityLabel table in the database.

- Duplicate labelnames might exist in the ROLEINIT XML for the above table.

- Modifying the ROLEINIT XML resolves the issue.

Troubleshooting Steps

To troubleshoot the issue, please follow the steps below:

- Select the table "HostServer.SecurityLabel" table in the database, select the XML under ROLEINIT, select the first line (starting with ) and copy to a notepad

- Identify if there are any duplicate LOGLEVEL's and LOGSIZE's or any other fields

- Modify the ROLEINIT XML accordingly

- Run the following query against the K2 database:

UPDATE K2.HostServer.SecurityLabel

SET RoleInit = '[paste modified ROLEINIT XML here]'

WHERE SecurityLabelName = 'K2'

Restart the K2 Service

The issue should now be resolved.