Issue

Unable to retrieve realm for SharePoint site: [SP Site URL] and an error appears when running Activate Site Collection from Site > Site Contents > K2 Blackpearl for SharePoint.

Symptoms

The following error appears when running Activate Site Collection from Site > Site Contents > K2 Blackpearl for SharePoint:

Unable to retrieve realm for SharePoint site: [Site URL]

Type:
SourceCode.SmartObjects.Client.SmartObjectException
Source:
SourceCode.SmartObjects.Client
Method Base
Member Type:
Method
Name:
ExecuteScalar
Module
Scope Name:
SourceCode.SmartObjects.Client.dll
Declaring Type
Full Name:
SourceCode.SmartObjects.Client.SmartObjectClientServer
Stack Trace:
at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteScalar(SmartObject smartObject, DataTable inputTable)
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 could be caused by the missing SSL configuration for the site on the Load Balance Device (NetScaler). 

A capture of the SmartObject log will show that the URL passed to the GetK2ServerUrlForSite method has http instead of https.

Adding SSL header for the site in NetScalers resolved this issue.