WSOD after 10.2.5 upgrade

Created on 18 April 2024, 2 months ago
Updated 7 June 2024, 21 days ago

Problem/Motivation

I just used composer to upgrade from my D10.1.8 to D10.2.5, updated the DB and cleared cache. Now my site shows WSOD with the following error:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct(): Argument #3 ($cache) must be of type Drupal\Core\Cache\VariationCacheInterface, Drupal\variationcache\Cache\VariationCache given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->__construct() (line 115 of core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php).

Drupal\Component\DependencyInjection\Container->createService(Array, 'dynamic_page_cache_subscriber') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('dynamic_page_cache_subscriber') (Line: 105)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 157)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ’¬ Support request
Status

Fixed

Version

1.0

Component
Dynamic page cacheΒ  β†’

Last updated 7 days ago

Created by

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

Comments & Activities

  • Issue created by @monaw
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    This looks like a VariationCache project issue. I'm moving the bug report there.

  • you might need to update the variationcache version to 8.x-1.4 https://www.drupal.org/project/variationcache/releases/8.x-1.4 β†’ and follow the release note instructions

    VariationCache is now part of Drupal core 10.2 and up. This release keeps it working on D10.0 and D10.1 but also makes it so it does not collide with D10.2 and actually uses the core classes by virtue of class_alias().

    Once you upgrade to Drupal 10.2 and none of your code still refers to the Drupal/variationcache namespace, it is safe and recommended to turn off and remove this module.

  • FYI, upgrade to VariationCache 1.4 gave the following error:

    The website encountered an unexpected error. Please try again later.

    TypeError: Drupal\flexible_permissions\ChainPermissionCalculator::__construct(): Argument #1 ($cache) must be of type Drupal\variationcache\Cache\VariationCacheInterface, Drupal\variationcache\Old\Cache\VariationCache given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\flexible_permissions\ChainPermissionCalculator->__construct() (line 63 of modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php).

    Drupal\Component\DependencyInjection\Container->createService(Array, 'flexible_permissions.chain_calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('flexible_permissions.chain_calculator', 1) (Line: 440)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'group_permission.calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('group_permission.calculator', 1) (Line: 440)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'group.anonymous_user_response_subscriber') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('group.anonymous_user_response_subscriber') (Line: 105)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 214)
    Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 202)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    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: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 49)
    Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    will try version 1.5...

  • VariationCache 1.5 didn't work either. i got WSOD with this error:

    The website encountered an unexpected error. Please try again later.

    TypeError: Drupal\flexible_permissions\ChainPermissionCalculator::__construct(): Argument #1 ($cache) must be of type Drupal\variationcache\Cache\VariationCacheInterface, Drupal\variationcache\Old\Cache\VariationCache given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\flexible_permissions\ChainPermissionCalculator->__construct() (line 63 of modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php).

    Drupal\Component\DependencyInjection\Container->createService(Array, 'flexible_permissions.chain_calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('flexible_permissions.chain_calculator', 1) (Line: 440)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'group_permission.calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('group_permission.calculator') (Line: 132)
    Drupal\group\QueryAccess\QueryAlterBase::create(Object) (Line: 43)
    Drupal\group\QueryAccess\EntityQueryAlter::create(Object) (Line: 28)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('Drupal\group\QueryAccess\EntityQueryAlter') (Line: 335)
    group_query_entity_query_alter(Object) (Line: 350)
    group_query_views_entity_query_alter(Object, NULL, NULL) (Line: 545)
    Drupal\Core\Extension\ModuleHandler->alter('query', Object) (Line: 495)
    Drupal\Core\Database\Query\Select->preExecute() (Line: 205)
    Drupal\views\Plugin\views\cache\CachePluginBase->generateResultsKey() (Line: 143)
    Drupal\views\Plugin\views\cache\CachePluginBase->cacheGet('results') (Line: 1434)
    Drupal\views\ViewExecutable->execute(NULL) (Line: 1469)
    Drupal\views\ViewExecutable->render() (Line: 199)
    Drupal\views\Plugin\views\display\Page->execute() (Line: 1645)
    Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 81)
    Drupal\views\Element\View::preRenderViewElement(Array)
    call_user_func_array(Array, Array) (Line: 111)
    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: 797)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 386)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
    Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
    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(Object, 'kernel.view') (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    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: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 49)
    Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    would appreciate any other suggestions...

  • is there an order dependency between upgrading this module and upgrading to D10.2.*? does it matter which order i do things?

  • i also tried upgrading field permission to the latest 1.1.0 but still getting WSOD with new error:

    The website encountered an unexpected error. Please try again later.

    TypeError: Drupal\flexible_permissions\ChainPermissionCalculator::__construct(): Argument #1 ($cache) must be of type Drupal\variationcache\Cache\VariationCacheInterface, Drupal\variationcache\Old\Cache\VariationCache given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\flexible_permissions\ChainPermissionCalculator->__construct() (line 63 of modules/contrib/flexible_permissions/src/ChainPermissionCalculator.php).

    Drupal\Component\DependencyInjection\Container->createService(Array, 'flexible_permissions.chain_calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('flexible_permissions.chain_calculator', 1) (Line: 440)
    Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'group_permission.calculator') (Line: 177)
    Drupal\Component\DependencyInjection\Container->get('group_permission.calculator') (Line: 132)
    Drupal\group\QueryAccess\QueryAlterBase::create(Object) (Line: 43)
    Drupal\group\QueryAccess\EntityQueryAlter::create(Object) (Line: 28)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('Drupal\group\QueryAccess\EntityQueryAlter') (Line: 335)
    group_query_entity_query_alter(Object) (Line: 350)
    group_query_views_entity_query_alter(Object, NULL, NULL) (Line: 545)
    Drupal\Core\Extension\ModuleHandler->alter('query', Object) (Line: 495)
    Drupal\Core\Database\Query\Select->preExecute() (Line: 205)
    Drupal\views\Plugin\views\cache\CachePluginBase->generateResultsKey() (Line: 143)
    Drupal\views\Plugin\views\cache\CachePluginBase->cacheGet('results') (Line: 1434)
    Drupal\views\ViewExecutable->execute(NULL) (Line: 1469)
    Drupal\views\ViewExecutable->render() (Line: 199)
    Drupal\views\Plugin\views\display\Page->execute() (Line: 1645)
    Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 81)
    Drupal\views\Element\View::preRenderViewElement(Array)
    call_user_func_array(Array, Array) (Line: 111)
    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: 797)
    Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 386)
    Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
    Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 592)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
    Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
    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(Object, 'kernel.view') (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    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: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 49)
    Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • to clarify, i went back to my D10.1.8 which worked and updated Variation Cache to 1.4 and got a WSOD error. Then I tried again with my D10.1.8 and updated Variation Cache to 1.5 and still got the WSOD error. i seem to be stuck...how do i upgrade to D10.2?

  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    If you are on D10.1 and upgrade VC to the latest version, clearing the container cache (which is probably broken by now) using the query "DELETE FROM cache_container;", your site should work. At that point you should be able to upgrade to D10.2

    Downgrading to Major as this issue would have blown up by now if everyone ran into it, so it's probably not happening across the board.

  • thanks kristiaanvandeneynde! however, if i upgrade VC, then the site is broken and i cannot do anything else. are you saying i should use the mysql client and manually go into the drupal database and run that delete command?

  • ok, i finally resolved this and was able to upgrade to 10.2.6, here are my steps:

    1. starting with D10.1.8
    2. upgrade Variation Cache β†’ to 1.5
    3. (the site now shows WSOD with error about flexible_permission and variationcache
    4. drush sqlc
    5. at the mysql prompt, enter "DELETE FROM cache_container;"
    6. upgrade drush to required 12.4.3
    7. upgrade to D10.2.6
    8. run update script

    hope this will help someone else...

  • Status changed to Fixed about 1 month ago
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Going to move this to a support request as I'm sure the issue queue would have blown up by now if everyone was facing this issue. It could very well be that your container cache was the problem to begin with.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024