\RouteNotFoundException: Route "entity.node.vmd_preview_list" does not exist.

Created on 25 January 2022, over 3 years ago
Updated 22 April 2023, about 2 years ago

A site of mine randomly ran into this error the other day. I was able to capture a copy of the database before it went away, and copying to my local recreates the issue.

Fortunately, clearing the cache easily fixed the issue. But it left the content people panicked for a bit, and ideally, this doesn't happen at all. Here is the full stack trace:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.node.vmd_preview_list" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 206 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: 95)
Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 786)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 377)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 449)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 450)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 65)
__TwigTemplate_ec871c933f9aa26c761e9fd7c5cd4a7c4c02b23d0d521b5166b2f737f7acdafb->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 65)
twig_render_template('themes/gesso/templates/layout/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 436)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 450)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 92)
__TwigTemplate_5d2d6488c1b241d919c1d99d458953d7075dcefccbaf55a9a73de85a7333327e->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 65)
twig_render_template('themes/gesso/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 436)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 163)
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: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 91)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
πŸ› Bug report
Status

Active

Version

2.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom zach.bimson

    Im going to try and recreate this, haven't got loads of time but im working on a 3.x release and if i solve this in ill commit to the new dev branch

  • πŸ‡¬πŸ‡§United Kingdom zach.bimson
  • πŸ‡ΊπŸ‡ΈUnited States gloryrose6

    I provided a hotfix patch to prevent site errors for those getting this issue seemingly at random. My client's site was getting this error for anonymous users, so it makes me think that this is a local task caching or dependency issue somewhere (the module uses the LocalTaskDefault class from core for it's local tasks). This patch checks if the route exists before providing the local task in the local task deriver class.

  • πŸ‡¬πŸ‡§United Kingdom zach.bimson

    @gtucker6 thanks for the patch, are you able to open a MR for this please ?

  • πŸ‡―πŸ‡΄Jordan mqanneh Amman

    Still getting the same using v3.0 and patch #12 πŸ› \RouteNotFoundException: Route "entity.node.vmd_preview_list" does not exist. Active

  • πŸ‡²πŸ‡½Mexico dalin πŸ‡¨πŸ‡¦, πŸ‡²πŸ‡½, 🌍

    Upping to critical since the site basically goes down when this happens.

    I'm not sure if this is a thing, but I've seen the error on two high traffic sites. We also run this module on smaller sites, and they haven't seen an issue.

  • Issue was unassigned.
  • Status changed to Needs work about 1 year ago
  • πŸ‡²πŸ‡½Mexico dalin πŸ‡¨πŸ‡¦, πŸ‡²πŸ‡½, 🌍

    Ack, we just hit this problem again. Just like @mqanneh the site in question is using v3.0 and patch #12.

    I think we'll have to uninstall the module until this is resolved.

  • πŸ‡ΊπŸ‡ΈUnited States robpowell Boston

    This is happening to me on deployments in Acquia. After a full cache rebuild, via drush and the Acquia UI, the issue is resolved.

  • πŸ‡¨πŸ‡¦Canada SKAUGHT

    #17
    cache clearing is not resolution. it's just a 'stop gap' to get back up.

    the problem is not just with an Acquia Deployment that this happens, i know this from my own direct experience in Acquia.

  • πŸ‡ΊπŸ‡ΈUnited States fizcs3 Omaha, Nebraska; USA

    Have had this module installed for quite some time without any issue...
    But now, have had a random WSOD a couple times recently, out of nowhere, for which we too are finding these errors in the log...
    Cannot seem to figure out how to reproduce it either -- but, clearing cache does fix the issue...

    We have multi-site running and it didn't happen on all sites, just on one site WSOD of the many, still obviously not good but odd...
    To confirm that this is not just an Acquia issue. We are running on Platform.sh.
    This is on D10.2.9, PHP 8.2.24, running view_modes_display 3.0.0.

    Current stack trace below:

    #0 /app/web/core/lib/Drupal/Core/Menu/LocalTaskDefault.php(45): Drupal\Core\Routing\RouteProvider->getRouteByName('entity.node.vmd...')
    #1 /app/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(310): Drupal\Core\Menu\LocalTaskDefault->getRouteParameters(Object(Drupal\Core\Routing\CurrentRouteMatch))
    #2 /app/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild('entity.node.can...', Object(Drupal\Core\Cache\CacheableMetadata))
    #3 /app/web/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(96): Drupal\Core\Menu\LocalTaskManager->getLocalTasks('entity.node.can...', 0)
    #4 /app/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
    #5 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array)
    #6 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array('Drupal\\block\\Bl...', Array)
    #7 /app/web/core/lib/Drupal/Core/Render/Renderer.php(859): Drupal\Core\Render\Renderer->doTrustedCallback('Drupal\\block\\Bl...', Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
    #8 /app/web/core/lib/Drupal/Core/Render/Renderer.php(421): Drupal\Core\Render\Renderer->doCallback('#pre_render', 'Drupal\\block\\Bl...', Array)
    #9 /app/web/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Render\Renderer->doRender(Array)
    #10 /app/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
    #11 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(475): Drupal\Core\Render\Renderer->render(Array)
    #12 /app/private/adecsite/twig/670b32b94fd89_page.html.twig_2X1IALXjLooWmJrE6dA_4L3tt/6Ou8NtTzKDU2-NFHNL7_1T1ebA7uTPt8E4ELy4QrO4o.php(216): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
    #13 /app/vendor/twig/twig/src/Template.php(393): __TwigTemplate_b431ca3ee6eb7c761b4f2fad183b900f->doDisplay(Array, Array)
    #14 /app/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
    #15 /app/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
    #16 /app/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
    #17 /app/web/core/themes/engines/twig/twig.engine(39): Twig\TemplateWrapper->render(Array)
    #18 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/c...', Array)
    #19 /app/web/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render('page', Array)
    #20 /app/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
    #21 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(475): Drupal\Core\Render\Renderer->render(Array)
    #22 /app/private/adecsite/twig/670b32b94fd89_html.html.twig_dnhZIHgLGwuoEu4k9Dv5lPDYn/STNTNqVGYNWeznYXzh_AVbeFl_N3GddjZDfbiE9feh0.php(178): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
    #23 /app/vendor/twig/twig/src/Template.php(393): __TwigTemplate_d2422b6a6e8c6d89ef25747246f799bb->doDisplay(Array, Array)
    #24 /app/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
    #25 /app/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
    #26 /app/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
    #27 /app/web/core/themes/engines/twig/twig.engine(39): Twig\TemplateWrapper->render(Array)
    #28 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/c...', Array)
    #29 /app/web/core/lib/Drupal/Core/Render/Renderer.php(480): Drupal\Core\Theme\ThemeManager->render('html', Array)
    #30 /app/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, false)
    #31 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(158): Drupal\Core\Render\Renderer->render(Array)
    #32 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #33 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(153): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #34 /app/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
    #35 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #36 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
    #37 /app/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
    #38 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
    #39 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #40 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #41 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #42 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #43 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #44 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #45 /app/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #46 /app/web/core/modules/ban/src/BanMiddleware.php(50): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #47 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #48 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #49 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #50 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #51 /app/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
    #52 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
    #53 {main}
    
  • πŸ‡¨πŸ‡¦Canada SKAUGHT

    thanks for confirming your hosting platform. Indeed, this module IS NOT STABLE!!

    this module is not maintained!

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Maybe someone here would like to request maintainership for the module?

    https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or... β†’

  • πŸ‡¬πŸ‡§United Kingdom zach.bimson

    Not sure that’s necessary, I don’t have time to work on a fix currently but I’m happy to review and manage merge requests. No one is yet to propose any changes…

  • πŸ‡ΊπŸ‡ΈUnited States fizcs3 Omaha, Nebraska; USA

    Possibly no one has proposed any changes yet because this is a heck of a random, difficult bug to track down.
    I last responded here 5 months ago, and since then have had no issues... until today, BOOM.

    We have a multi-site running. Pushed code changes to production. Cache is cleared before AND after config is imported. Despite that, found one site was down with WSOD at completion of deploy. Others were not. Same code base. Go figure. The one site down had dozens of these php errors in the dblog, triggered from completely different location/url's:

    Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.webform.vmd_preview_list" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of /app/web/core/lib/Drupal/Core/Routing/RouteProvider.php)
    

    Pretty much same message as in this issue's description, except it is on line 208 now (am on D10.3.13).
    The funny (and thankful) thing is that if I clear cache yet again to the WSOD site, the site does come back up and WSOD goes away.
    I could swear before that this error would just appear out of nowhere, not only after a deploy. I list this deploy example here because everything is fresh and the error still manages to appear.

    It's possible that Drupal just shouldn't take that error so hard (can't find a route? who cares, just throw it as a message in the dblog and move on, don't bring the site down for heavens sake, but that's not what Drupal likes to do).
    That's all I can share... if it can be of any help.

  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    I feel like this must be some sort of core race condition bug. I just had this happen again today, albeit with a route from a different module. This one was from the Preview Link module, and the error was:

    Exception 'Symfony\Component\Routing\Exception\RouteNotFoundException' with message 'Route "entity.node.preview_link_generate" does not exist.' in /code/services/drupal/web/core/lib/Drupal/Core/Routing/RouteProvider.php:211

    The common traits between these routes is that they are not defined in a normal *.routing.yml file. Instead they are dynamically generated via a "Derivitive" class. Berdir even comments there may be a race condition in his comment here β†’ . My guess is that there is a path that allows Drupal to cache it's list of available plugins without calling these dynamic Route providers via Derivitive classes.

  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    I just tried dropping a break point in the PreviewLinkTasks::getDerivativeDefinitions(), to see what calls that. interestingly, in the stack appears the Webform module's implementation of hook_menu_links_discovered_alter() where it calls::

    \Drupal::service('plugin.manager.menu.local_task')->getDefinitions(). 
    

    I wanted to see what would call that if webform wasn't there, and added a return statement at the top of webform's hook. It seems that the next in line to call getDefinitions is in LocalTaskManager, but tat is only prompted by BlockViewBuilder in what seems to be well into the rendering process.

    I'm not too sure what the overall Drupal philosophy is for rebuilding caches, but at face value, this does seem very bespoke to the instance of when/how/where a cache is being cleared, and I can see room for plugin definitions being loaded in different ways that might lead to this situation of dynamically generated routes not propogating.

Production build 0.71.5 2024