Skip to main content


 

Symptoms


Issue: Error when executing smartobject call - "Login failed for user 'K2userName'."
•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`2and propertyReference)

at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteListReader(SmartObject smartObject, ExecuteListReaderOptions options)

at SourceCode.Forms.AppFramework.FormsApiToXml.ToXmlList()

at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr)

at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml)

at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
 

Diagnoses


The service instance may be set to impersonate, meaning that the current user's credentials will be passed to SQL to execute the query. This allows for access to be restricted for sensitve data via SQL, and those SQL permissions are simply surfaced in K2 when the smartobject call is executed. In this case, K2userName did not have the needed permissions in SQL which caused the error
 

Resolution

Adding the K2userName account to SQL with appropriate permissions would resolve the issue, or switching to serviceaccount context for the service instance, so long as the K2Service account has the needed permissions in that case.




 
Be the first to reply!

Reply