Drush dcim throws: The log level "ok" does not exist.

Created on 29 June 2023, over 1 year ago
Updated 23 August 2024, 4 months ago

Summary

With the combination of:
Drush 11.5.1
Drupal 9.5.8
Composer 2.4.1
Default content 2.0.0-alpha1

Steps to reproduce

Running
drush dcim %module_name% -vvv
trows this error:

In Logger.php line 161:
                                      
  [Psr\Log\InvalidArgumentException]  
  The log level "ok" does not exist.  
                                      

Exception trace:
  at /var/www/html/vendor/consolidation/log/src/Logger.php:161
 Consolidation\Log\Logger->log() at /var/www/html/vendor/drush/drush/src/Log/Logger.php:44
 Drush\Log\Logger->log() at /var/www/html/vendor/consolidation/log/src/LoggerManager.php:149
 Consolidation\Log\LoggerManager->log() at /var/www/html/web/modules/contrib/default_content/src/Commands/DefaultContentCommands.php:144
 Drupal\default_content\Commands\DefaultContentCommands->contentImportModule() at n/a:n/a
 call_user_func_array() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:276
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:391
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1039
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:275
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:124
 Drush\Runtime\Runtime->doRun() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:51
 Drush\Runtime\Runtime->run() at /var/www/html/vendor/drush/drush/drush.php:77
 require() at /var/www/html/vendor/drush/drush/includes/preflight.inc:18
 drush_main() at phar:///usr/local/bin/drush/bin/drush.php:143
 require() at /usr/local/bin/drush:14

Proposed resolution

In other modules I see the similar issue and there are patches that 'ok' was changed with 'info'.
But in case there is no 'info' in LogLeve in drush , i changed it to Psr LogLevel

-      $this->logger()->log(LogLevel::OK, $message);
+      $this->logger()->log(\Psr\Log\LogLevel::INFO, $message);
🐛 Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

🇱🇹Lithuania seemas

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

Comments & Activities

Production build 0.71.5 2024