getting an error when following instructions on module page https://www.drupal.org/project/drupalmoduleupgrader

Drupal in installed locally in MAMP

drush is installed via: composer global require webflo/drush-shim

drush en drupalmoduleupgrader

Command pm-enable needs a higher bootstrap level to run - you will need to invoke [error]
drush from a more functional Drupal environment to run this command.
The drush command 'en drupalmoduleupgrader' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured
database. In this case you can select another site with a working database setup by
specifying the URI to use with the --uri parameter on the command line. See `drush
topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the
php-cli may have no access to it in a jailed shell. See

Comments

Anonymous’s picture

brody created an issue. See original summary.

Anonymous’s picture

I was able to fix the issue by adding unix socket in setting.php like:

'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

however a new issue has arise when running drush dmu-analyze MODULE_NAME from Drupal root folder


Indexing...done.
TypeError: Argument 2 passed to                                                                             [error]
Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver::__construct() must be of the type array,
null given, called in
/Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php
on line 27 in Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver->__construct() (line 16 of
/Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php)
#0
/Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php(27):
Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver->__construct(Object(Drupal\Core\StringTranslation\TranslationManager),
NULL)
#1
/Users/brodyr/Documents/Sites/drupal-8/core/lib/Drupal/Core/Plugin/Discovery/ContainerDerivativeDiscoveryDecorator.php(20):
Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver::create(Object(Drupal\Core\DependencyInjection\Container),
'_flag_hook')
#2
/Users/brodyr/Documents/Sites/drupal-8/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(99):
Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator->getDeriver('_flag_hook', Array)
#3
/Users/brodyr/Documents/Sites/drupal-8/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87):
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#4 /Users/brodyr/Documents/Sites/drupal-8/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(283):
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#5 /Users/brodyr/Documents/Sites/drupal-8/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(174):
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#6 /Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(108):
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#7 /Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(249):
_dmu_plugin_list('analyzer')
#8 phar:///Users/brodyr/.composer/vendor/webflo/drush-shim/phar/drush.phar/includes/command.inc(422):
drush_drupalmoduleupgrader_dmu_analyze('commerce_funds')
#9 phar:///Users/brodyr/.composer/vendor/webflo/drush-shim/phar/drush.phar/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#10 phar:///Users/brodyr/.composer/vendor/webflo/drush-shim/phar/drush.phar/includes/command.inc(199):
drush_command('commerce_funds')
#11 phar:///Users/brodyr/.composer/vendor/webflo/drush-shim/phar/drush.phar/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#12 phar:///Users/brodyr/.composer/vendor/webflo/drush-shim/phar/drush.phar/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /Users/brodyr/.composer/vendor/webflo/drush-shim/bin/drush.php(106): drush_main()
#14 /Users/brodyr/.composer/vendor/webflo/drush-shim/bin/drush(4): require('/Users/brodyr/....')
#15 {main}.
TypeError: Argument 2 passed to Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver::__construct() must be of the type array, null given, called in /Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php on line 27 in Drupal\drupalmoduleupgrader\Plugin\DMU\Analyzer\FlagHookDeriver->__construct() (line 16 of /Users/brodyr/Documents/Sites/drupal-8/modules/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/FlagHookDeriver.php).
Drush command terminated abnormally due to an unrecoverable error.                                          [error]
HongPong’s picture

Title: getting error when drush en drupalmoduleupgrader » getting error when drush en drupalmoduleupgrader (MAMP) / needs a higher bootstrap level to run
Status: Active » Postponed (maintainer needs more info)

Can you give the results of drush status when that command is run from the root of the drupal installation? This module requires a working Drupal environment be available to drush. Putting this as "needs more info" until we know what is going on with drush status.

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)