Presentation URL root domain on load balanced environment returning 404 on single CD server

Dean Lynn asked on August 25, 2022 21:36

We have a Kentico Xperience 13 solution; our websites are built using ASP.NET Core.

Our Staging (UAT) environment has:

  • a Content Management server,
  • 2 load balanced Content Delivery servers.

The website definition has:

  • Presentation URL configured as the load balanced URL,
  • dedicated domain aliases, one assigned for each Content Delivery server.

We can access the CD1 website via:

  • https://www.website-url.com
  • https://cd1.website-url.com

And the CD2 website via:

  • https://www.website-url.com
  • https://cd2.website-url.com

We have an intermittent problem occurring immediately following deployment to this environment.

After successfully deploying the CMS code, our basic ASP.NET Core website deployment process is as follows:

  • switch off the CD1 website,
  • deploy a new version of the website,
  • start the CD1 website,
  • request the direct URL (https://cd1.website-url.com) to load the website and check it is operational.

We then repeat the above process for CD2.

These deployments happen in sequence i.e. we fully deploy CD1 before moving on to CD2.

The issue we are seeing is that once deployed CD1 fails to load the website using the load balanced Presentation URL.

The following requests and responses are observed:

  • https://cd1.website-url.com/ - 200 OK
  • https://cd1.website-url.com/a-sub-page - 200 OK
  • https://www.website-url.com/ - 404 Page not found
  • https://www.website-url.com/a-sub-page - 200 OK

Note from above results: subpages access via the load balanced Presentation URL respond as expected. What fails is the Presentation URL root domain which returns a 404.

The same issue does not appear to affect the CD2 server, however, this issue is highly unpredictable.

Restarting the server (Windows rather than IIS) causes the following behaviour to then be witnessed:

  • https://cd1.website-url.com/ - 404 Page not found
  • https://cd1.website-url.com/a-sub-page - 200 OK
  • https://www.website-url.com/ - 404 Page not found
  • https://www.website-url.com/a-sub-page - 200 OK

Note from the above results: subpages still function, but now both CD1 and www root domains fail.

Both CD1 and CD2 load their settings from the same database and therefore will be aware of the same load balanced Presentation URL.

Has anyone seen a similar issue?

Can anyone point me in the direction of CMS or IIS settings to review?

Thanks,

Dean


Update: 26 August 2022 @ 09:27

Our UAT environment is powered down overnight and then booted in the morning.

This affects the database and all web servers.

After this full shutdown and boot, the CD1 website URL resolution now functions as expected.

This adds to the unpredictable nature of the issue; restarting the single CD1 server yesterday compounded the problem. A full restart of the entire environment appears to have temporarily resolved it.

Going from our experience with this issue, it is likely to reappear as we deploy more versions of the solution.

I am unsure if this offers any clues, a full reboot does differ in the sense that the CM and database are also powered down and no warmup URLs are requested on individual servers during the boot process.

Correct Answer

Dean Lynn answered on August 31, 2022 12:59

Hi Eugene.

Thanks for replying, your comment prompted me to turn on debug for everything, everywhere and explore the more detailed logging recorded on disk.

The SQL log revealed the problem.

I could see the root domain was recognised and correctly translated to the /Home node but the requests were using the en-US culture when the only supported culture in the content is en-GB.

This means that the requests would fail to locate the content and return a 404.

The visitor culture setting in the site definition was set to automatic, I assume this resulted in some requested being identified as en-US (and therefore failing) and others as en-GB (and therefore working).

Setting the culture to be fixed as en-GB appears to have resolved the issue.

Thanks.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Eugene Paden answered on August 30, 2022 20:45

What are you using or how are you configuring load balancing?

Did you find entries on the error logs on CD1? Or the Kentico logs?

2 votesVote for this answer Mark as a Correct answer

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