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

K2 logs are flooded with the following error which mentions non-existing/decomissioned K2 server:

28039 Could not connect to %SERVER_NAME% 

Symptoms

In certain scenarios (i.e. migration of an existing K2 installation to the new server, removal of the server node from the farm) your K2 database may contain references to the K2 server node which no longer exists. This floods the K2 host server logs with the error message as K2 constantly tries to connect to the missing server.

Resolution

You need to remove the non-existing server references from the K2 database. As always, before attempting to remove anything be sure to backup your K2 database, then perform the steps described below.

1. Execute stored procedure Server.kClusterDown which removes references to the node from all the relevant tables, i.e.: Server.ProcInst Server.DestQueue Server.Async Server.IPCAsync Server.ClusterMessage
To do that you run this stored procedure specifying IDs (note: IDs not sever names) from Server.Server table as a parameters:

@ServerID = NEW SERVERID / ID OF THE SERVER WHICH STAYS IN YOUR FARM

@ClusterServerID = OLD SERVERID / ID OF THE SERVER WHICH YOU REMOVED FROM YOUR FARM

@ServerDownTimeout = 0

2. Once you executed this stored procedure, remove references to the old server from the following tables:

Server.Server

HostServer.Server 

HostServer.LicenseKey -- License can be deleted from K2 Workspace/Management GUI

3. After removing references to the old server from the K2 database, restart the K2 host server service to allow it to re-read changed configurations from the database.

-- The license can be deleted from K2 Workspace/Management GUI

Do not modify any database definition or database content unless specifically instructed to do so by K2. No changes to the K2 Database definition or content are supported unless specifically instructed by K2. 
Direct read access or modification of the data in the K2 database is also not supported, unless specifically instructed by K2, except for the ServerLog table where direct read access is supported. 
Any modification of the K2 database or content may result in system instability or failure, therefore it is highly recommended to make backups of the K2 database prior to performing any modification, even when instructed to do so by K2. 
This database schema reference is provided for informational purposes only. Note that database schemas may change between product versions, so if you have written custom queries against the K2 database, those queries may break between product versions.