Issue

The following error is displayed in the K2 Management page:

Image

Symptoms

This issue can occur when you access the "Users > K2 > Domains" option.

Image

The full error message looks like this:

An item with the same key has already been added.
  • Type:
    SourceCode.SmartObjects.Client.SmartObjectException
  • Source:
    SourceCode.SmartObjects.Client
  • Method Base
    • Member Type:
      Method
    • Name:
      GetSmartObjectReader
    • Module
      • Scope Name:
        SourceCode.SmartObjects.Client.dll
    • Declaring Type
      • Full Name:
        SourceCode.SmartObjects.Client.SmartObjectClientServer
  • Stack Trace:
    at SourceCode.SmartObjects.Client.SmartObjectClientServer.GetSmartObjectReader(SmartObject smartObject, ExecuteListReaderOptions options, Dictionary`2& propertyReference)
    at SourceCode.Forms.AppFramework.FormsApiToXml.GetSmartObjectReader(ExecuteListReaderOptions options)
    at SourceCode.Forms.AppFramework.FormsApiToXml.ToListResults(SmartMethodBase executedMethod, Boolean overrideListCount)
    at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(BrokerSmartObject brokerSmo, SmartObjectBrokerMetaData brokerMetaData, Boolean outputDependencies, SmartObjectClientServer smoClientServer, Queue`1 soInstances)
    at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(BrokerPackageCollection packages, SmartObjectClientServer smoClientServer)
    at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(Stream input, Stream output)
    at SourceCode.Forms.Runtime.AJAXCall.ProcessRequestInternal(HttpContext context

Resolution

This issue may occur because you have a duplicate value in your K2 Database inside the [HostServer].[SecurityLabel] table.

It is possible you may have a duplicate value within your "K2" Security label under the "RoleInit" column, for example:

MultiDomain=False;OnlyUseSecurityGroups=False;LogLevel=Error;LogSize=0;LogSize=0;

To resolve this issue please contact K2 Support, as direct database modification is not supported.