Symptoms
You may face a situation when you are unable to start K2 Host Server service with an Error 1053: The service did not respond to the start or control request in a timely fashion. Service freezes in Starting state in Services snap-in until you kill the process using Windows Task Manager. Essentially K2 service fails to start and not writing anything into log in such scenario.
Diagnoses
As K2 service fails before start writing a log file the only way to get an insight into possible cause of an error is to run it in console mode, using appropriate shortcut from Start menu.
Most common causes here are locked network ports required by K2 blackpearl service, missing configuration files or lack of access to files required for K2 service to start - and it is possible to see exact problem when K2 service started in console mode.
Some examples of specific possible issue which may be causing this:
Example A:
You may see the following error message in console window:
Error Invoking 'StartHostServer' : SourceCode.HostServerLib : Method 'ParseFullyQualifiedUserName' in type 'SourceCode.Hosting.Server.Runtime.HostSecurityManager' from assembly 'SourceCode.HostServerLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d' does not have an implementation.
This could be caused by the fat that SourceCode.HostServerInterfaces.dll file was registered in GAC whereas it should not be there.
Removal of this file from GAC will resolve this issue.
Example B:
After starting K2 service in console mode it is possible to see that some configuration file is missing. File may be deleted by mistake during old log files clean up or K2 service account may do not have file system level permissions to access them - these things are easy to check by navigating to appropriate location and checking if file is in place and whether K2 service account has access to it.
Resolution
Most common causes here are locked network ports required by K2 blackpearl service, missing configuration files or lack of access to files required for K2 service to start - and it is possible to see exact problem when K2 service started in console mode.