Skip to main content

I've installed 2 new Servers in my QA environment connecting to the same database server as my previous 2 K2 QA Servers.
Now when I try to start the K2 Host Server (As the Service Account) on the new servers it fails with the following message in the K2 Console:
;K2 HostServer Console Mode
;======================================
;Loading .NET Framework v4.0.30319
;Framework loaded successfully.
;Creating Host Server Runtime.
;Press ESC to end..

;Error Invoking 'StartHostServer' : SourceCode.HostServerLib : Configuration sys
tem failed to initialize


;Stopped Hosting Server Runtime
Press any key to continue...

In Event Viewer I saw the following Error:
2001 Error Starting Host Server: Failed to decrypt using provider 'K2ConfigurationKey'. Error message from the provider: The parameter is incorrect.
(C:Program Files (x86)K2 blackpearlHost ServerBinK2HostServer.exe.Config line 135)

I searched on the community site and found that this relates to the rights to the Crypto folder in: C:ProgramDataApplication DataMicrosoftCryptoRSAMachineKeys.
I granted my service account full rights to this folder as well as to the service account's folder with the same path.
Still it does not work. I no longer see the error in Even Viewer.

Does anyone have any other suggestions? 

Your help will be much appreciated.

Hi

 

As somthing to try, make sure that you are starting the K2 Service using the K2 service account and not another logged on user .  If you are still having issues with your host server startup  you could log a ticket to the K2 support team to assist you further with the subject.

 

 

Regards

 

Peter


Hi Peter,

 

Thank you for your suggestion.

I was logged in as the service account when I got this error and been trying to start the K2 Server in console mode while logged in as the Service Account since the beginning.

 

I already have a ticket open with K2 support, I also logged it here to see if I can get some more responses while we investigate.

 

Please let me know if you can think of anything else which might help.

 

Regards,

JohanL


Hi All,

 

Just to update...

 

I have uninstalled one of the servers, installed it to the same DB server but to a new K2 DB.

This works and the server starts up without any issues.

I also uninstalled the same server and reinstalled it to a new K2 DB on a different SQL Server and this worked.

So I know the K2 Server and SQL Server is fine and that it is nothing on these.

 

Which left only one thing, the existing K2 DB.

I took a backup of the existing K2 DB and I restored it to a new SQL Server.

I then uninstalled my K2 Server and then installed it by Adding a new server to the K2 Server Farm.

When I do this I get an installation warning on the K2 Server component.

The logs revealed the following:

18:1: SourceCodeLog.LogMsg: 14:29:24:>> Logged Warning: Could not import cert from db: System.FormatException: Invalid character in a Base-64 string.
at System.Convert.FromBase64String(String s)

 

This seems to be the root cause.

 

Can anyone help me on how to resolve this?

It seems to be that the certificate in the DB is perhaps corrupt.

As this is an existing DB how can I refresh this certificate or create a new one?

 

Please advise.

 

Thank you,

JohanL


Hi All,

 

The certificate error was due to the SCHostServerCert not being registered on the new SQL Server. After fixing that and uninstalling/reinstalling I did not get the error in the setup logs.

However, the K2 Server still does not want to start.

 

It clearly has something to do with the existing database, but I cannot figure out what it could be.

Any ideas?

 

Regards,

JohanL


Hi All,

 

K2 Labs Support spotted and resolved the problem.

For some reason when adding a server to an existing K2 Server farm the resulting K2HostServer.exe.config file contains entries in the <configuration> section before specifying the <configSections> node.

This is the root cause of the error.

To resolve this, I needed to move the <configSections> section to be directly under the <configuration> tag.

Once I did this the K2 Server started up.

 

Lesson learnt here is that your K2HostServer.exe.config file should always start with the <configSections> node. 

If yours does not, you will probably encounter this error, but it is simple to resolve.

 

Kind Regards,

JohanL


Reply