Web farm error "Invalid URI: The format of the URI could not be determined."

Tom Troughton asked on October 7, 2015 11:50


I'm setting up a web farm with two load balanced web servers. I want Kentico to generate the servers automatically so I have the following web.config settings on both servers:

<add key="CMSURLPort" value="80" />
<add key="CMSWebFarmGenerateServers" value="true" />
<add key="CMSWebFarmUseDBUpdater" value="true" />

In Kentico my settings are:

Image Text

I can see both servers have auto-created in the Web Farm module. However, my Event Log is reporting a lot of errors (source: Web Farm) like this:

Message: Invalid URI: The format of the URI could not be determined.

Exception type: System.UriFormatException
Stack Trace:
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at CMS.WebFarmSync.UrlWebFarmUpdater.Notify(String url)

When I look at the auto-generated settings for each web farm server I see that the "Server root URL" looks like this: I know that if I was setting these servers up myself then this URL would have to be a proper URL e.g. If I change this value to add the http:// prefix then the errors seem to go away, but now I'm getting license limitation warnings because I haven't added licenses for these internal IP URLs (and don't want to because I want to be confident my setup will work automatically if I add an additional web server to the load balanced set).

After all this I'm looking for answers to 2 questions:

  1. Why are these servers being auto-generated with values that cause Kentico errors to be logged
  2. Why are these URLs even being used

I hope can help. Thanks in advance.

Correct Answer

Filip Ligač answered on October 14, 2015 17:39


To answer both of your questions - actually if you use a web farm database updater, you can disregard those errors since the web farm tasks are synchronized through database and WF server URLs do not matter.

In any case, there was a bug regarding this error while having automatically generated servers which was fixed in the 8.2.28 hotfix. Details of the bug are following:
Web farms - Automatically generated WF servers generating 'Invalid URI' error When web farms were set to generate servers automatically with the URL notifications synchronization mechanism enabled, the server root URL didn't contain the http(s) protocol which could result in the following error in the event log: "Message: Invalid URI: The format of the URI could not be determined."

If you want to find some more information about how web farms work in Kentico 8.x, we have got a really useful Knowledge Base article about that from the leading developer of the web farm module - Kentico 8 Technology – Web farm synchronization.

Best regards,

0 votesVote for this answer Unmark Correct answer

Recent Answers

Tom Troughton answered on October 19, 2015 10:33

Filip, thank you, this is really helpful.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.