"Index was outside the bounds of the array" error appears when SXA website is down


Description

Sitecore might become unresponsive and cause the SXA website to go down. Symptoms might include SC Hotfix 468030-1 SXA 9.3.0.2589.zip installed, high CPU usage, slow response time and the following error in the logs:

Exception: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: mscorlib
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Sitecore.XA.Foundation.Multisite.SiteInfoResolver.IsMatchingPath(Item item, SiteInfo siteInfo)

Solution

To resolve the issue, consider one of the following options: