TypeError: Unsupported operand types: null + array in Drupal\Core\Cron->__construct() (line 133 of /var/www/html/web/core/lib/Drupal/Core/Cron.php) #0 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(261): Drupal\Core\Cron->_

Created on 8 January 2025, 12 days ago

Problem/Motivation

TypeError: Unsupported operand types: null + array in Drupal\Core\Cron->__construct() (line 133 of /var/www/html/web/core/lib/Drupal/Core/Cron.php) #0 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(261): Drupal\Core\Cron->__construct()
#1 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(179): Drupal\Component\DependencyInjection\Container->createService()
#2 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Cron.php(64): Drupal\Component\DependencyInjection\Container->get()
#3 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\ProxyClass\Cron->lazyLoadItself()
#4 /var/www/html/web/vendor/drush/drush/src/Commands/core/DrupalCommands.php(64): Drupal\Core\ProxyClass\Cron->run()
#5 [internal function]: Drush\Commands\core\DrupalCommands->cron()
#6 /var/www/html/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#7 /var/www/html/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#8 /var/www/html/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#9 /var/www/html/web/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#10 /var/www/html/web/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#11 /var/www/html/web/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#12 /var/www/html/web/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#13 /var/www/html/web/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#14 /var/www/html/web/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#15 /var/www/html/web/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#16 /var/www/html/web/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#17 {main}.

Steps to reproduce

While running cron via drush I am facing this issue
While I have not been able to find exact steps to reproduce but I have found that $queue_config set via \Drupal::getContainer()->getParameter('queue.config'); turns out to be null

if (!isset($queue_config)) {
      @trigger_error('Calling ' . __METHOD__ . '() without the $queue_config argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3343743', E_USER_DEPRECATED);
      $queue_config = \Drupal::getContainer()->getParameter('queue.config');
    }

so the below code throws error

if ($queue_config) {
      $this->queueConfig = $queue_config + [
        'suspendMaximumWait' => 30.0,
      ];
    }

Proposed resolution

Add a condition to check if $queue_config is null

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.3

Component

cron system

Created by

🇮🇳India hash6

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024