Problem/Motivation
I encountered a weird issue while updating an existing site: after composer updated radix from 5.0.10 to 5.0.11, the components module was removed, and if you run drush commands after that, you get
pc@pc:~/lando-projects/drupal10.localhost(Drupal10)$ drush cr
[error] AssertionError: The file specified by the given app root, relative path and file name (/app/web/modules/contrib/components/components.info.yml) do not exist. in assert() (line 73 of /app/web/core/lib/Drupal/Core/Extension/Extension.php) #0 /app/web/core/lib/Drupal/Core/Extension/Extension.php(73): assert(false, 'The file specif...')
#1 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(114): Drupal\Core\Extension\Extension->__construct('/app/web', 'module', 'modules/contrib...', NULL)
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\Core\Extension\ModuleHandler->__construct('/app/web', Array, Object(Drupal\Core\Cache\ChainedFastBackend))
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'module_handler')
#4 /app/web/core/lib/Drupal/Core/DrupalKernel.php(588): Drupal\Component\DependencyInjection\Container->get('module_handler')
#5 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(229): Drupal\Core\DrupalKernel->preHandle(Object(Symfony\Component\HttpFoundation\Request))
#6 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(236): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), NULL)
#7 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(422): Drush\Boot\BootstrapManager->doBootstrap(5, 6, NULL)
#8 /app/vendor/drush/drush/src/Application.php(228): Drush\Boot\BootstrapManager->bootstrapMax()
#9 /app/vendor/drush/drush/src/Application.php(194): Drush\Application->bootstrapAndFind('cr')
#10 /app/vendor/symfony/console/Application.php(262): Drush\Application->find('cr')
#11 /app/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /app/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /app/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /app/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#15 /app/vendor/drush/drush/drush(4): require('/app/vendor/dru...')
#16 /app/vendor/bin/drush(120): include('/app/vendor/dru...')
#17 {main}.
AssertionError: The file specified by the given app root, relative path and file name (/app/web/modules/contrib/components/components.info.yml) do not exist. in /app/web/core/lib/Drupal/Core/Extension/Extension.php on line 73 #0 /app/web/core/lib/Drupal/Core/Extension/Extension.php(73): assert(false, 'The file specif...')
#1 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(114): Drupal\Core\Extension\Extension->__construct('/app/web', 'module', 'modules/contrib...', NULL)
#2 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\Core\Extension\ModuleHandler->__construct('/app/web', Array, Object(Drupal\Core\Cache\ChainedFastBackend))
#3 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'module_handler')
#4 /app/web/core/lib/Drupal/Core/DrupalKernel.php(588): Drupal\Component\DependencyInjection\Container->get('module_handler')
#5 /app/vendor/drush/drush/src/Boot/DrupalBoot8.php(229): Drupal\Core\DrupalKernel->preHandle(Object(Symfony\Component\HttpFoundation\Request))
#6 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(236): Drush\Boot\DrupalBoot8->bootstrapDrupalFull(Object(Drush\Boot\BootstrapManager), NULL)
#7 /app/vendor/drush/drush/src/Boot/BootstrapManager.php(422): Drush\Boot\BootstrapManager->doBootstrap(5, 6, NULL)
#8 /app/vendor/drush/drush/src/Application.php(228): Drush\Boot\BootstrapManager->bootstrapMax()
#9 /app/vendor/drush/drush/src/Application.php(194): Drush\Application->bootstrapAndFind('cr')
#10 /app/vendor/symfony/console/Application.php(262): Drush\Application->find('cr')
#11 /app/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /app/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /app/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /app/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#15 /app/vendor/drush/drush/drush(4): require('/app/vendor/dru...')
#16 /app/vendor/bin/drush(120): include('/app/vendor/dru...')
#17 {main}
AssertionError: The file specified by the given app root, relative path and file name (/app/web/modules/contrib/components/components.info.yml) do not exist. in assert() (line 73 of /app/web/core/lib/Drupal/Core/Extension/Extension.php).
[warning] Drush command terminated abnormally.
If you install a new site, the same thing happens, no components module is downloaded:
pc@pc:~/lando-projects/drupal10.localhost$ composer require drupal/radix
./composer.json has been updated
Running composer update drupal/radix
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking drupal/radix (5.0.11)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing drupal/radix (5.0.11): Extracting archive
Generating autoload files
44 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found
Using version ^5.0 for drupal/radix
kaszarobert@acer-travelmate-p215-41-g2:~/lando-projects/drupal10.localhost$
If you look in the module's composer.json, the dependency setting is there:
"require-dev": {
"consolidation/robo": "^1.1.4 || ^2",
"drush/drush": "^11.6 || ^12"
},
"require": {
"drupal/components": "^3.0"
},
It can be fixed by requiring drupal/components manually but that's not a good practice, a module or theme should always declare its dependencies, so we don't have to do that for each and every package.
Could you please look at it what went wrong in the latest release?
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork radix-3385325
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
doxigo commentedHi Robert, thanks for bringing this up, fixed