Symptoms
I attempt to go and configure K2 for Sharepoint Configuration and I receive the error:
Invalid URI: The format of the URI could not be determined. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at SourceCode.SharePoint.ApplicationPages.WebControls.EnvironmentLibrarySection.PopulateEnvSPSiteUrlFields()
at SourceCode.SharePoint.ApplicationPages.WebControls.K2InputFormSectionControl.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Diagnoses
The problem was because of a wrong value for the SharePoint Site URL saved when migrating the K2 server.
Resolution
There were 2 environment variable fields with blank value (SharePoint Site URL) type, the issue was resolved after updating with the corrected SharePoint URLs.