The following error frequently gets logged in the K2 HostServer error logs and the Windows Event Viewer:

Error: "2936429982","2017-06-12 18:45:25","Error","EventBus","7498","General","ServerDAL.RefreshService","7498 An error has occurred: System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at SourceCode.EventBus.Server.ServerDAL.RefreshService() ClientConnectionId:1187a19a-23b2-42b5-af32-0de82ccac41d Error Number:-2,State:0,Class:11","anonymous","","SERVER:C:\Program Files (x86)\K2 blackpearl\Host Server\Bin","2936429982","b0b8541973b84c68bdd0d0f886410e50",""


There is no impact on K2 but it gets logged frequently.

Troubleshooting Steps

There are a few workarounds you can try to resolve the error, but there is no definite solution for this issue:

1. Decrypt your K2HostServer.exe.config file and add "Max Pool Size=200" to the following Connection String, so it appears like this:

<add name="HostserverDB" connectionString="Data Source=DLX;Initial Catalog=K2;integrated security=sspi;Pooling=True;Max Pool Size=200"
providerName="K2BLACKPEARL" />

Decrypt your K2HostServer.exe.config file first, here are the steps:

- Copy the K2HostServer.exe.config file from the C:\Program Files (x86)\K2 blackpearl\Host Server\bin folder to C:\Temp and rename it web.config.

- Open a command prompt as Administrator and change the directory to C:\Windows\Microsoft.NET\Framework\v2.0.5727 and run the following command:

aspnet_regiis -pdf "connectionStrings" C:\Temp

- This decrypts the connection string section in the file and you can then make the changes. Afterwards, please save it again as K2HostServer.exe.config and put it back in the [K2 Blackpearl]\Host Server\Bin\ directory and start/restart the K2 Blackpearl Service.

After decrypting the file, you will be able to see saved passwords, please be mindful and remove temporary copies for security reasons!

2. If the "Domain Users" AD Group is being used in Process Rights for certain processes, consider switching to Everyone (a special K2 group).

- This has to do with the "Domain Users" AD Group being a group in AD, which K2 needs to synchronize and keep track of in the Identity table. It includes a lot of users, so in order for K2 to synchronize every time a user tries to start a process, it will use a lot of resources. If the K2 special group "Everyone" is used, then there should be no resources being used because every user will get authenticated by K2.

3. Follow this article to clear your completed Eventbus tables:

- The stored procedure will clear out the history log tables of the Eventbus when they become too full. If the numbers approach +-10,000 then you can consider running that stored procedure with an input property of "4" (to clear out only the completed entries).

4. This issue could also be performance related. For example: 

   a) Trying to pull a large set of records
   b) Index fragmentation
   c) Lack of proper indexes.

- Is regular index maintenance being performed?
- If it happens frequently, you could run an SQL profiler trace on the K2 and application database to see what might be executing when the error appears.

For more information on index defragmentation, have a look here (under the Maintenance section):