Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal console exception #896

Closed
epfremmer opened this issue Dec 29, 2016 · 4 comments
Closed

Drupal console exception #896

epfremmer opened this issue Dec 29, 2016 · 4 comments
Labels
Bug Something isn't working

Comments

@epfremmer
Copy link

My system information:

  • Operating system type: macOS
  • Operating system version: 10.12.2
  • BLT version: 8.6.5

When I run this command:

vendor/bin/drupal list

I get the following output:

Recoverable fatal error: Argument 1 passed to Drupal\metatag\Command\GenerateGroupCommand::__construct() must be an instance of Drupal\metatag\Generator\MetatagGroupGenerator, none given in /var/www/kraken/docroot/modules/contrib/metatag/src/Command/GenerateGroupCommand.php on line 57 #0 /var/www/kraken/docroot/core/includes/bootstrap.inc(548): _drupal_error_handler_real(4096, 'Argument 1 pass...', '/var/www/kraken...', 57, Array)
#1 /var/www/kraken/docroot/modules/contrib/metatag/src/Command/GenerateGroupCommand.php(57): _drupal_error_handler(4096, 'Argument 1 pass...', '/var/www/kraken...', 57, Array)
#2 [internal function]: Drupal\metatag\Command\GenerateGroupCommand->__construct()
#3 /var/www/kraken/vendor/drupal/console/src/Helper/CommandDiscoveryHelper.php(282): ReflectionClass->newInstance()
#4 /var/www/kraken/vendor/drupal/console/src/Helper/CommandDiscoveryHelper.php(220): Drupal\Console\Helper\CommandDiscoveryHelper->validateCommand('Drupal\\metatag\\...', 'metatag', 'module')
#5 /var/www/kraken/vendor/drupal/console/src/Helper/CommandDiscoveryHelper.php(159): Drupal\Console\Helper\CommandDiscoveryHelper->extractCommands('/var/www/kraken...', 'metatag', 'module')
#6 /var/www/kraken/vendor/drupal/console/src/Helper/CommandDiscoveryHelper.php(117): Drupal\Console\Helper\CommandDiscoveryHelper->discoverCommands(Array)
#7 /var/www/kraken/vendor/drupal/console/src/Helper/CommandDiscoveryHelper.php(75): Drupal\Console\Helper\CommandDiscoveryHelper->getCustomCommands()
#8 /var/www/kraken/vendor/drupal/console/src/Application.php(312): Drupal\Console\Helper\CommandDiscoveryHelper->getCommands()
#9 /var/www/kraken/vendor/drupal/console/src/Application.php(245): Drupal\Console\Application->prepare(Object(Drupal\Console\Helper\DrupalHelper), 'list')
#10 /var/www/kraken/vendor/symfony/console/Application.php(124): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/kraken/vendor/drupal/console/bin/drupal.php(115): Symfony\Component\Console\Application->run()
#12 /var/www/kraken/vendor/drupal/console/bin/drupal(4): require('/var/www/kraken...')
#13 {main}
Recoverable fatal error: Argument 1 passed to Drupal\metatag\Command\GenerateGroupCommand::__construct() must be an instance of Drupal\metatag\Generator\MetatagGroupGenerator, none given in Drupal\metatag\Command\GenerateGroupCommand->__construct() (line 57 of /var/www/kraken/docroot/modules/contrib/metatag/src/Command/GenerateGroupCommand.php).

And I expected this to happen:

normal drupal console command list output

Additional Information:

It looks like BLT is using an earlier version of the drupal/console package. Currently this has a hard version constraint in the blt composer.json locked at 1.0.0-beta5. This in combination with the use of the metatag module produce this exception due to the earlier version of the drupal console instantiating console commands by hand through reflection before they implemented a compiler pass to retrieve them from the service container.

Since the commands included in the metatag module have constructor arguments drupal console is unable to run.

Possible Solutions:

  • Change the drupal/console constraint from 1.0.0-beta5 to something less restrictive like ^1.0 to allow console updates as well as more control of the dependency from the project.
@grasmash
Copy link
Contributor

@epfremmer Working on an update here: #887

Unfortunately, an update does not resolve the console issue.

@epfremmer
Copy link
Author

epfremmer commented Dec 29, 2016

@grasmash That is super weird. It does look like it changed the error wherein before we had a missing constructor argument (Drupal\metatag\Generator\MetatagGroupGenerator) it changed to a fatal error thrown in MetatagGroupGenerator when it couldn't autoload the Drupal\Console\Generator\Generator class.

Its as if drupal/console-core wasn't installed or is missing from the autoloader, but I see composer installing it in the build logs.

@grasmash grasmash added the Bug Something isn't working label Jan 3, 2017
@grasmash
Copy link
Contributor

grasmash commented Jan 4, 2017

@epfremmer Drupal console was updated in #887.

@grasmash grasmash closed this as completed Jan 4, 2017
@epfremmer
Copy link
Author

@grasmash 👍 thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants