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
- In a drupal 10.1 install the scheduler and drush ^11
- After installing the module, using composer upgrade the scheduler to version ^2.x
- 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.