Upgrade to Components! 3.0.0-beta3 breaks website

Created on 11 April 2023, about 1 year ago
Updated 21 April 2023, about 1 year ago

Problem/Motivation

Website runs on Drupal core 9.5.7 on a Raspberry PI-3. Following error can be found in the log after upgradi,ng the Components! module:

Error: Class "Drupal\components\Template\ComponentsInfo" not found in Drupal\Component\DependencyInjection\Container->createService() (regel 259 van /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php)

#0 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#1 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
#2 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
#3 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#4 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(434): Drupal\Component\DependencyInjection\Container->get()
#5 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(273): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
#6 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(449): Drupal\Component\DependencyInjection\Container->createService()
#7 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(237): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters()
#8 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService()
#9 /var/www/pi3.softpol.net/web/core/lib/Drupal.php(207): Drupal\Component\DependencyInjection\Container->get()
#10 /var/www/pi3.softpol.net/web/core/themes/engines/twig/twig.engine(47): Drupal::service()
#11 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
#12 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
#13 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
#14 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
#15 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render()
#16 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#17 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext()
#18 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#19 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#20 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#21 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#22 /var/www/pi3.softpol.net/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#23 /var/www/pi3.softpol.net/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#24 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#25 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#26 /var/www/pi3.softpol.net/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#27 /var/www/pi3.softpol.net/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#28 /var/www/pi3.softpol.net/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#29 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#30 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#31 /var/www/pi3.softpol.net/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#32 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#33 /var/www/pi3.softpol.net/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#34 {main}

.

Steps to reproduce

pi@pi3:/var/www/pi3.softpol.net $ composer require 'drupal/components:^3.0@beta'
./composer.json has been updated
Running composer update drupal/components
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading drupal/components (2.4.0 => 3.0.0-beta3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Upgrading drupal/components (2.4.0 => 3.0.0-beta3): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Generating autoload files
58 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

To bring the website back to service:

pi@pi3:/var/www/pi3.softpol.net $ composer require 'drupal/components:^2.4'
./composer.json has been updated
Running composer update drupal/components
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Downgrading drupal/components (3.0.0-beta3 => 2.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downgrading drupal/components (3.0.0-beta3 => 2.4.0): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Generating autoload files
58 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium softpol

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.

  • Issue created by @softpol
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    That service is no longer called. Did you run database updates and clear cache?
    I just updated this module on one of the sites I manage, before running updates and clearing cache I got the same error.
    After running db updates and clearing cache the site loads as expected.

    Please confirm this works.

  • πŸ‡ΊπŸ‡ΈUnited States mefron

    Wanted to chime in that I have the same issue. N.B. db updates/cache clear do not resolve the problem.

    For context, this is running on a site using D9.5.7 as I prepare for migration to D10.

  • πŸ‡§πŸ‡ͺBelgium softpol

    I normally clear cache and update DB from the admin UI. This is not possible after upgrade to Components! 3.0.0-beta3, because the website is broken. So, I did the DB update with drush, but I got no system prompt back after 3 updates (and killed the proces with :

    pi@pi3:/var/www/pi3.softpol.net $ vendor/bin/drush updatedb
    ------------ ---------------- ------------- ---------------------------------
    Module Update ID Type Description
    ------------ ---------------- ------------- ---------------------------------
    components components_reg post-update Clear caches to allow
    istry_cache_pa components.registry service to
    ths cache template paths.
    components components_reg post-update Clear caches to load new
    istry_service components.registry service.
    components components_twi post-update Clear caches to load updated
    g_loader_servi components.twig.loader service.
    ce
    ------------ ---------------- ------------- ---------------------------------

    Do you wish to run the specified pending updates? (yes/no) [yes]:
    >

    > [notice] Update started: components_post_update_components_registry_cache_paths
    > [notice] Update completed: components_post_update_components_registry_cache_paths
    > [notice] Update started: components_post_update_components_registry_service
    > [notice] Update completed: components_post_update_components_registry_service
    > [notice] Update started: components_post_update_components_twig_loader_service
    > [notice] Update completed: components_post_update_components_twig_loader_service

    ^C

    I then did a clear cache with drush:

    pi@pi3:/var/www/pi3.softpol.net $ vendor/bin/drush cache-rebuild
    [success] Cache rebuild complete.

    and retried the DB update. AFter a long wait, I got a bunch of error messages, ending with:

    PHP Fatal error: Uncaught Symfony\Component\Routing\Exception\RouteNotFoundException: Route "" does not exist. in /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Routing/RouteProvider.php:206
    Stack trace:
    #0 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Routing/UrlGenerator.php(432): Drupal\Core\Routing\RouteProvider->getRouteByName()
    #1 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Routing/UrlGenerator.php(270): Drupal\Core\Routing\UrlGenerator->getRoute()
    #2 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php(105): Drupal\Core\Routing\UrlGenerator->generateFromRoute()
    #3 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Url.php(765): Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute()
    #4 /var/www/pi3.softpol.net/web/modules/contrib/visitors/src/EventSubscriber/KernelTerminateSubscriber.php(152): Drupal\Core\Url->toString()
    #5 [internal function]: Drupal\visitors\EventSubscriber\KernelTerminateSubscriber->onTerminate()
    #6 /var/www/pi3.softpol.net/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
    #7 /var/www/pi3.softpol.net/vendor/symfony/http-kernel/HttpKernel.php(103): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #8 /var/www/pi3.softpol.net/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #9 /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/DrupalKernel.php(702): Stack\StackedHttpKernel->terminate()
    #10 /var/www/pi3.softpol.net/vendor/drush/drush/src/Boot/DrupalBoot8.php(310): Drupal\Core\DrupalKernel->terminate()
    #11 [internal function]: Drush\Boot\DrupalBoot8->terminate()
    #12 {main}
    thrown in /var/www/pi3.softpol.net/web/core/lib/Drupal/Core/Routing/RouteProvider.php on line 206

    But eventually the website was again up…

    I don't know if I applied the right commands, or in the right order. It would be good to add some additional instructions to the upgrade procedure.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    That is documented here: https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-com... β†’
    Generally though you want to run drush updb first then clear cache.

    Unfortunately what I suspect is happening is that the pi was just running out of memory trying to run the updates. I'm glad you were able to get it working though.

  • πŸ‡©πŸ‡ͺGermany kreatIL

    I can confirm that. In my case running drush cr right after I upgraded from Components 8.x-2.4 to version 3.0.0-beta3 broke the whole site und crashed it's Docker container.

    In a second attempt I ran drush updb before clearing the caches. This time I succeeded.

Production build 0.69.0 2024