Hitting an average of 20 nodes (http full pages requests, not Entity Loads) during a drush cr gives me impredictable results, some mentioning either that Field moderation_state is unknown or that Route entity.node.latest_version does not exist.
These pages will stay as HTTP 500 error pages until a clear cache without traffic puts everything back in place.
Enough for me to suspect a bug on the content_moderation module. Unfortunately I have no more clues at the moment.
A variant :
InvalidArgumentException: Field moderation_state is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField()
(line 580 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get("moderation_state") (Line: 285)
Drupal\content_moderation\EntityOperations->entityView(Array, Object, Object, "full") (Line: 172)
content_moderation_entity_view(Array, Object, Object, "full")
call_user_func_array("content_moderation_entity_view", Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll("entity_view", Array) (Line: 270)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 220)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
Another variant :
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.node.latest_version" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 202 of core/lib/Drupal/Core/Routing/RouteProvider.php).
Drupal\Core\Menu\LocalTaskDefault->getRouteParameters(Object) (Line: 310)
Drupal\Core\Menu\LocalTaskManager->getTasksBuild("entity.node.canonical", Object) (Line: 358)
Drupal\Core\Menu\LocalTaskManager->getLocalTasks("entity.node.canonical", 0) (Line: 94)
Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func("Drupal\block\BlockViewBuilder::preRender", Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, "html", NULL, 1) (Line: 65)
__TwigTemplate_e0e5c03852788b844753634506d4ceb0082bd18845b7eea1c67638d5d649c658->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template("themes/bespoke/rdcmobile/templates/layout/page.html.twig", Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render("page", Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, "html", NULL, 1) (Line: 90)
__TwigTemplate_be8c7bbb9c824f2826368d7c8da984c6279779db72a67fd8056a00bb23b816f2->doDisplay(Array, Array) (Line: 432)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 403)
Twig_Template->display(Array) (Line: 411)
Twig_Template->render(Array) (Line: 64)
twig_render_template("core/themes/classy/templates/layout/html.html.twig", Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render("html", Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, "kernel.view", Object)
call_user_func(Array, Object, "kernel.view", Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch("kernel.view", Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 184)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 121)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 75)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
pguillard commentedComment #3
pguillard commentedComment #4
pguillard commentedComment #5
pguillard commentedComment #6
pguillard commentedComment #7
sam152 commentedI tried to reproduce this by spam clicking "View" on an entity that is moderated while the cache was clearing but wasn't able to get any errors. This could have been to do with the browser rate-limiting connections to a single server though. It sounds like your traffic was with an authenticated user if it was attempting to build a local task to the latest-version route. Was there some kind of code or tool you were using which you might be able to share that could reproduce this issue?
Comment #8
pguillard commentedI forgot to update this issue, good idea to close that one.
It was due to a personal mistake (Incorrect configuration of a service tag priority, on a service class that was extended)
Comment #9
ultimike@pguillard - I'm seeing similar behavior on a client site that I'm helping out with - can you provide some additional details about your "incorrect configuration of a service tag priority"?
thanks,
-mike