Symptoms
The following error is seen when running the registration wizard for the K2 blackpearl for SharePoint 2013 app Registration Wizard in SharePoint 2013:
"Error Receiving Buffer:An existing connection was forcibly closed by the remote host"
This happens when K2 blackpearl 4.6.8 is installed on the K2 Server.
Diagnoses
This error is thrown on a connection to the Workflow Management server when trying to make a smartobject call that sends information about a SharePoint 2013 site over to K2 to configure the Application to run on that particular SharePoint site.
However, the call seems to be made to the farm and a connection is opened then closed because it is either the wrong host name or the wrong port.
Resolution
This item can be resolved by making sure that the encrypted connection strings in the K2HostServer.exe.config file for K2 Host Server and K2 Workflow Server have the same host defined as the LBHOSTSERVER variable in the HostServer.Configuration table in the K2 database. After making sure these items matched, the registration wizard runs successfully.
The recommended method of changing a farm name and making sure these connection strings match across the board is to run a Configure on the K2 blackpearl installation.
However, in 4.6.8, it seems a config does not update the encrypted connection string values should the farm name change for a K2 environment. This has been logged as a bug and attached to the following bug item, which is fixed in 4.6.10:
Bug 533363: Installation - Reconfigure - When changing the Farm name, the K2HostServer.exe.config does not reflect the changes
Please contact K2 Support in order to receive direction on how to decrypt the connection strings in the K2HostServer.exe.config file, and how to make changes to those connection strings in a supported manner.