Symptoms
I have this error when Registration Wizard for K2 Apps is launched.
VALIDATIONThe remote server returned an error: (403) Forbidden.Failed to initialize the Context: URL: http://portal.ecm.serial.ch Username: Error Details: Method: SharePointService.initializeContext
•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(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr)
at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml)
at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
Diagnoses
Redeploying the app usually resolves this issue
Resolution
I've seen this issue resolved by re-deploying the app to the SharePoint App Server. This means you must run the K2 for SharePoint 4.6.9 installer on the actual SharePoint server, the file is called "AppDeployment.exe". Try to redeploy the app.
You'll notice that there is a new update available to the App from the SharePoint / Office Online store. I suggest you also update to that latest version, it will resolve issues when you're using O365 since there will be some changes made to trust.k2.com that will necessitate you upgrade to the latest version of the K24SP app.
Another thing to check is the K2 Service account has Admin permissions on the site collection in question.