Error enabling Google Analytics module after uninstall

Created on 7 February 2023, almost 2 years ago
Updated 16 August 2023, over 1 year ago
  1. drush pm-uninstall google_analytics -y
  2. drush en google_analytics -y

[error] Error: Call to a member function grantPermission() on null in google_analytics_install() (line 17 of /var/www/html/web/modules/contrib/google_analytics/google_analytics.install) #0 [internal function]: google_analytics_install()
#1 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array()
#2 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(357): Drupal\Core\Extension\ModuleHandler->invoke()
#3 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#4 /var/www/html/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php(103): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#5 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable()
#6 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#7 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#9 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#10 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#11 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
#12 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#13 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#14 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#15 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun()
#16 /var/www/html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#17 /var/www/html/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/html/v...')
#18 phar:///usr/local/bin/drush/bin/drush.php(143): drush_main()
#19 /usr/local/bin/drush(14): require('phar:///usr/loc...')
#20 {main}.
[07-Feb-2023 15:53:39 UTC] Error: Call to a member function grantPermission() on null in /var/www/html/web/modules/contrib/google_analytics/google_analytics.install on line 17 #0 [internal function]: google_analytics_install()
#1 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(417): call_user_func_array()
#2 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(357): Drupal\Core\Extension\ModuleHandler->invoke()
#3 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#4 /var/www/html/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php(103): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#5 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable()
#6 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#7 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#9 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#10 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#11 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
#12 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#13 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#14 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#15 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun()
#16 /var/www/html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#17 /var/www/html/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/html/v...')
#18 phar:///usr/local/bin/drush/bin/drush.php(143): drush_main()
#19 /usr/local/bin/drush(14): require('phar:///usr/loc...')
#20 {main}
Error: Call to a member function grantPermission() on null in google_analytics_install() (line 17 of /var/www/html/web/modules/contrib/google_analytics/google_analytics.install).
[warning] Drush command terminated abnormally.

🐛 Bug report
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇧🇪Belgium Vacilando Brussels

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

Comments & Activities

Production build 0.71.5 2024