Argument #9 ($kernel) must be of type ?

Created on 5 June 2024, 5 months ago
Updated 20 August 2024, 3 months ago

Problem/Motivation

After upgrading to Core 10.3.0-rc1 I get the following error:

TypeError: Drupal\Core\Theme\Registry::__construct(): Argument #9 ($kernel) must be of type ?Symfony\Component\HttpKernel\HttpKernelInterface, string given, called in /var/www/html/web/themes/contrib/bootstrap/src/Plugin/Alter/ThemeRegistry.php on line 44 in Drupal\Core\Theme\Registry->__construct() (line 188 of core/lib/Drupal/Core/Theme/Registry.php).

Output log:

#0 /var/www/html/web/themes/contrib/bootstrap/src/Plugin/Alter/ThemeRegistry.php(44): Drupal\Core\Theme\Registry->__construct('/var/www/html/w...', Object(Drupal\Core\Cache\DatabaseBackend), Object(Drupal\Core\ProxyClass\Lock\DatabaseLockBackend), Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\Core\Extension\ThemeHandler), Object(Drupal\Core\Theme\ThemeInitialization), Object(Drupal\Core\Cache\ChainedFastBackend), Object(Drupal\Core\Extension\ModuleExtensionList), 'swatek_bucko')
#1 /var/www/html/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(25): Drupal\bootstrap\Plugin\Alter\ThemeRegistry->__construct(Array, 'theme_registry', Array)
#2 /var/www/html/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('theme_registry', Array)
#3 /var/www/html/web/themes/contrib/bootstrap/src/Plugin/PluginManager.php(84): Drupal\Component\Plugin\PluginManagerBase->createInstance('theme_registry', Array)
#4 /var/www/html/web/themes/contrib/bootstrap/src/Bootstrap.php(302): Drupal\bootstrap\Plugin\PluginManager->createInstance('theme_registry', Array)
#5 /var/www/html/web/themes/contrib/bootstrap/bootstrap.theme(139): Drupal\bootstrap\Bootstrap::alter('bootstrap_theme...', Array, NULL, NULL)
#6 /var/www/html/web/core/lib/Drupal/Core/Theme/ThemeManager.php(458): bootstrap_theme_registry_alter(Array, NULL, NULL)
#7 /var/www/html/web/core/lib/Drupal/Core/Theme/Registry.php(433): Drupal\Core\Theme\ThemeManager->alterForTheme(Object(Drupal\Core\Theme\ActiveTheme), 'theme_registry', Array)
#8 /var/www/html/web/core/lib/Drupal/Core/Theme/Registry.php(281): Drupal\Core\Theme\Registry->build()
#9 /var/www/html/web/core/lib/Drupal/Core/Utility/ThemeRegistry.php(88): Drupal\Core\Theme\Registry->get()
#10 /var/www/html/web/core/lib/Drupal/Core/Utility/ThemeRegistry.php(69): Drupal\Core\Utility\ThemeRegistry->initializeRegistry()
#11 /var/www/html/web/core/lib/Drupal/Core/Theme/Registry.php(319): Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:...', Object(Drupal\Core\Cache\ChainedFastBackend), Object(Drupal\Core\ProxyClass\Lock\DatabaseLockBackend), Array, true)
#12 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(194): Drupal\Core\Theme\Registry->getRuntime()
#13 /var/www/html/web/core/modules/node/src/NodeViewBuilder.php(61): Drupal\Core\Entity\EntityViewBuilder->getBuildDefaults(Object(Drupal\node\Entity\Node), 'full')
#14 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(157): Drupal\node\NodeViewBuilder->getBuildDefaults(Object(Drupal\node\Entity\Node), 'full')
#15 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(123): Drupal\Core\Entity\EntityViewBuilder->viewMultiple(Array, 'full', NULL)
#16 /var/www/html/web/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php(134): Drupal\Core\Entity\EntityViewBuilder->view(Object(Drupal\node\Entity\Node), 'full')
#17 /var/www/html/web/core/modules/node/src/Controller/NodeViewController.php(66): Drupal\Core\Entity\Controller\EntityViewController->view(Object(Drupal\node\Entity\Node), 'full')
#18 [internal function]: Drupal\node\Controller\NodeViewController->view(Object(Drupal\node\Entity\Node), 'full', NULL)
#19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#20 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#36 {main}

πŸ› Bug report
Status

Fixed

Version

3.30

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States adrianm6254

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

Merge Requests

Comments & Activities

  • Issue created by @adrianm6254
  • First commit to issue fork.
  • Merge request !41Resolve #3452819 "Argument 9 kernel" β†’ (Merged) created by hosterholz
  • Pipeline finished with Success
    5 months ago
    Total: 147s
    #192542
  • πŸ‡ΊπŸ‡ΈUnited States adrianm6254

    I applied MR !41 and the error is gone.

    Thanks!

  • Status changed to RTBC 5 months ago
  • πŸ‡΅πŸ‡ΉPortugal jcnventura

    This fixed the theme for me in Drupal core 10.3.0. Please commit.

  • πŸ‡¨πŸ‡¦Canada dadderley Vancouver

    Just upgrades a small site to drupal 10.3.0
    I am using Bootstrap 8.x-3.30 as a base theme.

    The result is WSOD

    34184   20/Jun 22:04   php      Error      TypeError: Drupal\Core\Theme\Registry::__construct(): Argument #9
                                                 ($kernel) must be of type
                                                 ?Symfony\Component\HttpKernel\HttpKernelInterface, string given, called
                                                 in /home/customer/www/da
    

    Is there a new release coming?

  • πŸ‡§πŸ‡ΎBelarus f1mishutka Minsk

    With release of 10.3.0 this issue became critical show stopper. Could we have it released ASAP please?

    Thanks!

  • πŸ‡¬πŸ‡§United Kingdom Biren

    I experience the same with Drupal 10.3.0. The new release is needed immediately.

  • Same issue. Updated Drupal site from 10.1.8 to 10.3 today.

  • πŸ‡¦πŸ‡ΉAustria drupalfan2

    Because we do not get the new release, I generated this patch file.

  • πŸ‡·πŸ‡ΊRussia pick_d

    Had the same issue with 10.3.0 Drupal core release.
    However, the patch from #10 fixed it for me. Thanks.

  • Pipeline finished with Skipped
    5 months ago
    #204901
  • First commit to issue fork.
  • πŸ‡¨πŸ‡¦Canada dadderley Vancouver

    Well, that was quick!

    Installed the new dev release

    public_html$ composer require 'drupal/bootstrap:3.x-dev@dev'
    ./composer.json has been updated
    Running composer update drupal/bootstrap
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 0 installs, 1 update, 0 removals
      - Upgrading drupal/bootstrap (3.30.0 => dev-3.x f47794c)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 1 update, 0 removals
      - Syncing drupal/bootstrap (dev-3.x f47794c) into cache
      - Removing drupal/bootstrap (3.30.0)
      - Installing drupal/bootstrap (dev-3.x f47794c): Cloning f47794c3f8 from cache
    Generating autoload files
    Hardening vendor directory with .htaccess and web.config files.
    51 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    Cleaning installed packages.
    No security vulnerability advisories found

    Proceeded to update to Drupal 10.3.0
    All is well.

    Thankyou

  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    Full release coming soon. I'm checking other issues to see if there is anything else that should go in the release.

  • πŸ‡ΊπŸ‡ΈUnited States Chris Matthews

    Thank you all for the quick turnaround. I rolled back to 10.2.7 for now.

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

  • I was getting the "Argument #9 ($kernel) must be of type" error after updating to Drupal 10.3.1, and it was resolved after updating Bootstrap to 3.31, except now the update.php page does not load. The database did update with Drush but the update.php page does not load even after clearing and rebuilding caches. All other admin and site pages I have checked seem to work.

    The log now shows "Argument #2 must be of type array . . ."

    Here is the full output:

    TypeError: array_diff(): Argument #2 must be of type array, null given in /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php on line 702

    #0 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(702): array_diff(Array, NULL)

    #1 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(677): Drupal\Core\Theme\Registry->mergePreprocessFunctions('block__system_m...', 'block', Array, Array)

    #2 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(791): Drupal\Core\Theme\Registry->completeSuggestion('block__system_m...', Array)

    #3 /mnt/www/html/web/docroot/themes/contrib/bootstrap/src/Plugin/Alter/ThemeRegistry.php(161): Drupal\Core\Theme\Registry->postProcessExtension(Array, Object(Drupal\Core\Theme\ActiveTheme))

    #4 /mnt/www/html/web/docroot/themes/contrib/bootstrap/src/Bootstrap.php(303): Drupal\bootstrap\Plugin\Alter\ThemeRegistry->alter(Array, NULL, NULL)

    #5 /mnt/www/html/web/docroot/themes/contrib/bootstrap/bootstrap.theme(139): Drupal\bootstrap\Bootstrap::alter('bootstrap_theme...', Array, NULL, NULL)

    #6 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(458): bootstrap_theme_registry_alter(Array, NULL, NULL)

    #7 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(433): Drupal\Core\Theme\ThemeManager->alterForTheme(Object(Drupal\Core\Theme\ActiveTheme), 'theme_registry', Array)

    #8 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(274): Drupal\Core\Theme\Registry->build()

    #9 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Utility/ThemeRegistry.php(88): Drupal\Core\Theme\Registry->get()

    #10 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Utility/ThemeRegistry.php(69): Drupal\Core\Utility\ThemeRegistry->initializeRegistry()

    #11 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/Registry.php(319): Drupal\Core\Utility\ThemeRegistry->__construct('theme_registry:...', Object(Drupal\Core\Update\UpdateBackend), Object(Drupal\Core\ProxyClass\Lock\DatabaseLockBackend), Array, true)

    #12 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(141): Drupal\Core\Theme\Registry->getRuntime()

    #13 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('html', Array)

    #14 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, true)

    #15 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/Renderer.php(153): Drupal\Core\Render\Renderer->render(Array, true)

    #16 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()

    #17 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/Renderer.php(154): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

    #18 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php(66): Drupal\Core\Render\Renderer->renderRoot(Array)

    #19 /mnt/www/html/web/docroot/core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php(76): Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)

    #20 /mnt/www/html/web/docroot/core/modules/system/src/Controller/DbUpdateController.php(205): Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)

    #21 [internal function]: Drupal\system\Controller\DbUpdateController->handle('info', Object(Symfony\Component\HttpFoundation\Request))

    #22 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array(Array, Array)

    #23 /mnt/www/html/web/docroot/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))

    #24 /mnt/www/html/web/docroot/update.php(27): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

    #25 {main}

  • πŸ‡³πŸ‡ΏNew Zealand derekthatcher Christchurch

    I have the same issue as #19. Managed to get update script to run by removing block--system-menu-block--main.html.twig and block--system-menu-block--account.html.twig files.

  • πŸ‡¬πŸ‡§United Kingdom vijaycs85 London, UK

    Facing this issue. I assume the fix is available from version >=3.31.

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

    Updating bootstrap worked for me after updating core to 10.3.

    - "drupal/bootstrap": "^3.29",
    + "drupal/bootstrap": "^3.32",

Production build 0.71.5 2024