Too few arguments to function Drupal\scheduler\SchedulerManager::__construct()

Created on 8 August 2023, over 1 year ago
Updated 10 August 2023, over 1 year ago

Problem/Motivation

I don't know if this is happening to anyone else, but I'm upgrading the module version from 1.5 to 2.0.1, the upgrade was really easy and all the hook updates were executed without any issues. But when I've tried to execute the cron using drush core-cron, I got the following error:

ArgumentCountError: Too few arguments to function Drupal\scheduler\SchedulerManager::__construct(), 7 passed in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and at least 8 expected in /app/web/modules/contrib/scheduler/src/SchedulerManager.php on line 96 #0 /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259)

Which is a weird error, but anyway, I've tried to clean up the cache using drush cr, and the error persists, then I've tried: drush php:eval "drupal_flush_all_caches();"(I don't know if there's any differecence between using drupal_flush_all_caches or drush cr). But the error persisted. The last thing I've tried here was truncate the cache tables using the following snippet:

TRUNCATE cache_config;
TRUNCATE cache_container;
TRUNCATE cache_data;
TRUNCATE cache_default;
TRUNCATE cache_discovery;
TRUNCATE cache_dynamic_page_cache;
TRUNCATE cache_entity;
TRUNCATE cache_menu;
TRUNCATE cache_render;
TRUNCATE cache_toolbar;

The tables were truncated but the error is still happening.

PS: I didn't tried to uninstall and install the module again, I have a lot of modules depending on the scheduler, and uninstalling the module is not an option for me.

Steps to reproduce

  1. In a drupal 10.1 install the scheduler and drush ^11
  2. After installing the module, using composer upgrade the scheduler to version ^2.x
  3. Execute the drush core-cron

Proposed resolution

It's not a properly solution, but maybe validating these new services on constructor and instantiate then solved the issue for me.

💬 Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇧🇷Brazil murilohp

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

Comments & Activities

Production build 0.71.5 2024