Recurrent exception 'Umbraco.Core.Exceptions.PanicException: failed to get root with id'

I created a GitHub-issue as well.

Bug summary
Umbraco 8.13.0

This exception keeps getting thrown:

Umbraco.Core.Exceptions.PanicException: failed to get root with id=1276
   at Umbraco.Web.PublishedCache.NuCache.ContentStore.GetRequiredLinkedNode(Int32 id, String description, Nullable`1 gen) in D:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\ContentStore.cs:line 923
   at Umbraco.Web.PublishedCache.NuCache.ContentStore.<GetAtRoot>d__64.MoveNext() in D:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\ContentStore.cs:line 1240
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)

When calling this method:

public static Site? SiteNode(this UmbracoHelper umbracoHelper)
{
    return umbracoHelper.ContentAtRoot()
        .OfType<Site>()
        .FirstOrDefault();
}

The method call is happening in a Hangfire job where we get an UmbracoHelper by calling:

private UmbracoHelper GetUmbracoHelper()
{
    _umbracoContextFactory.EnsureUmbracoContext();
    return DependencyResolver.Current.GetService<UmbracoHelper>();
}

If we save & publish the node a few times it fixes the issue temporarily until it returns a few moments later.

In the background we are using the content service to create and update descendants of the node (but not the node that is logged). That might be related?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/106408-recurrent-exception-umbracocoreexceptionspanicexception-failed-to-get-root-with-id