Cannot install from existing config

Created on 11 July 2023, over 1 year ago
Updated 23 January 2024, 10 months ago

Problem/Motivation

When installing drupal from an existing configuration that contains this module, installation fails with the following error:

Error: Call to a member function grantPermission() on null in google_analytics_install() (line 17 of /var/www/drupal/web/modules/contrib/google_analytics/google_analytics.install) #0 [internal function]: google_analytics_install()
#1 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(400): call_user_func_array()
#2 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(357): Drupal\Core\Extension\ModuleHandler->invoke()
#3 /var/www/drupal/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#4 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(872): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#5 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(624): Drupal\Core\Config\ConfigImporter->processExtension()
#6 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(561): Drupal\Core\Config\ConfigImporter->processExtensions()
#7 /var/www/drupal/web/core/lib/Drupal/Core/Config/Importer/ConfigImporterBatch.php(31): Drupal\Core\Config\ConfigImporter->doSyncStep()
#8 /var/www/drupal/web/core/includes/batch.inc(296): Drupal\Core\Config\Importer\ConfigImporterBatch::process()
#9 /var/www/drupal/web/core/includes/form.inc(955): _batch_process()
#10 /var/www/drupal/web/core/includes/install.core.inc(651): batch_process()
#11 /var/www/drupal/web/core/includes/install.core.inc(569): install_run_task()
#12 /var/www/drupal/web/core/includes/install.core.inc(119): install_run_tasks()
#13 /var/www/drupal/vendor/drush/drush/includes/drush.inc(69): install_drupal()
#14 /var/www/drupal/vendor/drush/drush/includes/drush.inc(53): drush_call_user_func_array()
#15 /var/www/drupal/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(169): drush_op()
#16 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#17 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#18 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#19 /var/www/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#20 /var/www/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process()
#21 /var/www/drupal/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#22 /var/www/drupal/vendor/symfony/console/Application.php(1081): Symfony\Component\Console\Command\Command->run()
#23 /var/www/drupal/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand()
#24 /var/www/drupal/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun()
#25 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#26 /var/www/drupal/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#27 /var/www/drupal/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#28 /var/www/drupal/vendor/drush/drush/drush(4): require('...')
#29 /var/www/drupal/vendor/bin/drush(120): include('...')
#30 {main}.
Error: Call to a member function grantPermission() on null in /var/www/drupal/web/modules/contrib/google_analytics/google_analytics.install on line 17 #0 [internal function]: google_analytics_install()

Steps to reproduce

1. Install this module on a blank drupal (10.1.1) site.
2. Export config: drush cex -y
3. Reinstall drupal from the configuration: drush si -y --existing-config
4. You should see the above error.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

RTBC

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bander2

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024