< class="prominent-subhead ">

K2 for SharePoint app registration wizard fails with "Unable to retrieve realm for SharePoint site" error

~~repeating-content.html~~
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.

Issue

After replacement/rebuild of the SharePoint farm and re-deploying K2 for SharePoint app, K2 for SharePoint App Registration Wizard fails on SharePoint Service Broker step with the following error:

Unable to retrieve realm for SharePoint site: https://%APP_ID%.domain.com/sites/appcatalog/K2forSharePoint

APP_ID in the error message refers to the APP_ID of the old SharePoint farm and does not match the one you see in the address bar.

Symptoms

Unable to register K2 for SharePoint app as Registration Wizard fails on SharePoint Service Broker step after migrating to a new SharePoint farm.

Resolution

In this scenario references to an old app ID have to be removed from K2 database. Namely, you will need to delete them from [Integration].[ProcessSharePointGeneralSetting] table following through the steps below:

Steps below involve direct modifications in the K2 database. Before attempting any of such steps be sure that you have K2 database backup in place and clear understanding of steps you are about to perform. In case of any doubts log a ticket with K2 support to get additional assistance.

1. Backup your K2 database

2. Execute the following SQL query against K2 database:

DELETE FROM [Integration].[ProcessSharePointGeneralSetting] WHERE SiteURL = -- Type in the url from error message in single quotes below 'https://%APP_ID%.domain.com/sites/appcatalog/K2forSharePoint'

3. Restart K2 service and run K2 for SharePoint App Registration Wizard again