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

Upgrading from 11.0.0 to 11.0.3 causes: Error: Call to undefined method Drush\Log\DrushLoggerManager::setErrorStream() in Robo\Log\ResultPrinter->setOutput() (line 27 of [...]\vendor\consolidation\robo\src\Log\ResultPrinter.php) #5042

Closed
Ambient-Impact opened this issue Jan 24, 2022 · 10 comments

Comments

@Ambient-Impact
Copy link

Describe the bug

Looks like there's an issue potentially introduced as a side effect of #5022

This occurs on both Windows 10 (local dev) and a remote Linux server (Debian I think) running PHP 8.1, Drupal 9.3.3, and Drush 11.0.3:

Error: Call to undefined method Drush\Log\DrushLoggerManager::setErrorStream() in [...]\vendor\consolidation\robo\src\Log\ResultPrinter.php on line 27 #0 [...]\vendor\consolidation\robo\src\Result.php(274): Robo\Log\ResultPrinter->setOutput(Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 [...]\vendor\consolidation\robo\src\Result.php(84): Robo\Result->resultPrinter()
#2 [...]\vendor\consolidation\robo\src\Result.php(40): Robo\Result->printResult()
#3 [...]\vendor\consolidation\robo\src\Result.php(159): Robo\Result->__construct(Object(Robo\Collection\Collection), 0, '', Array)
#4 [...]\vendor\consolidation\robo\src\Collection\Collection.php(528): Robo\Result::success(Object(Robo\Collection\Collection))
#5 [...]\vendor\consolidation\robo\src\Collection\Collection.php(518): Robo\Collection\Collection->runWithoutCompletion() #6 [...]\vendor\consolidation\robo\src\Collection\CollectionBuilder.php(609): Robo\Collection\Collection->run()
#7 [...]\vendor\consolidation\robo\src\Collection\CollectionBuilder.php(590): Robo\Collection\CollectionBuilder->runTasks()
#8 [...]\drupal\modules\ambientimpact\ambientimpact_core\src\Commands\InstallCommand.php(51): Robo\Collection\CollectionBuilder->run()
#9 [internal function]: Drupal\ambientimpact_core\Commands\InstallCommand->install(Array)
#10 [...]\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#11 [...]\vendor\consolidation\annotated-command\src\CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 [...]\vendor\consolidation\annotated-command\src\CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 [...]\vendor\consolidation\annotated-command\src\AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData)) #14 [...]\vendor\symfony\console\Command\Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 [...]\vendor\symfony\console\Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 [...]\vendor\symfony\console\Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 [...]\vendor\symfony\console\Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 [...]\vendor\drush\drush\src\Runtime\Runtime.php(121): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 [...]\vendor\drush\drush\src\Runtime\Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 [...]\vendor\drush\drush\drush.php(72): Drush\Runtime\Runtime->run(Array)
#21 [...]\vendor\drush\drush\drush(4): require('E:\\Web\\Omnipedi...')
#22 {main}
Error: Call to undefined method Drush\Log\DrushLoggerManager::setErrorStream() in Robo\Log\ResultPrinter->setOutput() (line 27 of [...]\vendor\consolidation\robo\src\Log\ResultPrinter.php).
 [warning] Drush command terminated abnormally.

To Reproduce

Run a custom command that uses Robo it seems.

Expected behavior

Not have a horrible error. :P

Actual behavior

See error.

Workaround

Downgrade to Drush 11.0.0

System Configuration

Q A
Drush version? 11.0.3
Drupal version? 9.3.3
PHP version 8.1.1 (Windows) / 8.1.0 (Linux)
OS? Linux and Windows

Additional information

Custom commands that seem to trigger the error:

@weitzman
Copy link
Member

Ping @greg-1-anderson

@weitzman
Copy link
Member

Looks like some upstream work is needed to support these Robo commands again https://drupal.slack.com/archives/C62H9CWQM/p1643068478123200

@Ambient-Impact
Copy link
Author

I appreciate it!

@greg-1-anderson
Copy link
Member

Planning on doing this, but haven't been able to yet.

@Ambient-Impact
Copy link
Author

No rush; it's just good to know it's on your radar and I can keep using 11.0.0 for now until it's fixed.

@greg-1-anderson
Copy link
Member

I released consolidation/log 2.1.0 to address this. I haven't updated Robo yet, but if Drush updated to the latest consolidation/log (or if you just updated the dependencies of your site), it might work just with this much change. Haven't tried, though.

@greg-1-anderson
Copy link
Member

The full fix, though, is for Drush to increase the minimum required version of Robo to the one that has the fix / tests, once it becomes available.

@Ambient-Impact
Copy link
Author

Awesome, will try and test this when I get a chance.

@Ambient-Impact
Copy link
Author

Finally got around to testing this, and consolidation/log 2.1.0 does indeed seem to fix it for me.

@weitzman
Copy link
Member

Thanks for checking. Folks who need this should make sure they have latest consolidation/log. log isn't a direct dependency of drush so nothing more to do here.

Ambient-Impact added a commit to neurocracy/omnipedia that referenced this issue Feb 16, 2022
drush-ops/drush#5042

  - Removing grasmash/yaml-expander (1.4.0)
  - Upgrading consolidation/log (2.0.4 => 2.1.0)
  - Upgrading consolidation/self-update (2.0.3 => 2.0.5)
  - Upgrading drush/drush (11.0.0 => 11.0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants