Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2016 at 07:01 UTC
Updated:
5 Mar 2019 at 09:04 UTC
Jump to comment: Most recent
I'm seeing intermittent errors such as the following one when web profiler is enabled. Disabling it fixes the problem. Tested with 1ddd7c5c642c17f8bb606369e9068ca8751cccb9.
The website encountered an unexpected error. Please try again later.
Recoverable fatal error: Argument 4 passed to Drupal\scheduler\SchedulerManager::__construct() must be an instance of Drupal\Core\Entity\EntityManager, instance of Drupal\webprofiler\Entity\EntityManagerWrapper given, called in x/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 281 and defined in Drupal\scheduler\SchedulerManager->__construct() (line 64 of modules/contrib/scheduler/src/SchedulerManager.php).
Drupal\scheduler\SchedulerManager->__construct(Object, Object, Object, Object, Object) (Line: 281)
Drupal\Component\DependencyInjection\Container->createService(Array, 'scheduler.manager') (Line: 181)
Drupal\Component\DependencyInjection\Container->get('scheduler.manager') (Line: 158)
Drupal::service('scheduler.manager') (Line: 390)
scheduler_cron()
call_user_func_array('scheduler_cron', Array) (Line: 382)
Drupal\Core\Extension\ModuleHandler->invoke('scheduler', 'cron') (Line: 199)
Drupal\Core\Cron->invokeCronHandlers() (Line: 124)
Drupal\Core\Cron->run() (Line: 79)
Drupal\Core\ProxyClass\Cron->run() (Line: 70)
Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate(Object, 'kernel.terminate', Object)
call_user_func(Array, Object, 'kernel.terminate', Object) (Line: 61)
Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object, 'kernel.terminate', Object) (Line: 116)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.terminate', Object) (Line: 124)
Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch('kernel.terminate', Object) (Line: 79)
Symfony\Component\HttpKernel\HttpKernel->terminate(Object, Object) (Line: 32)
Stack\StackedHttpKernel->terminate(Object, Object) (Line: 615)
Drupal\Core\DrupalKernel->terminate(Object, Object) (Line: 22)
Comments
Comment #2
jonathan1055 commentedHi grahl,
Is that webprofiler? Are you using it as part of Devel?
Yes, we have just converted the Scheduler cron and one of the api hooks into a service, and
Drupal\scheduler\SchedulerManageris new, committed on 13th April - details in #2651338: Create a service for the Scheduler API.I don't know about the structure difference, regarding the expected
Drupal\Core\Entity\EntityManagerversus the receivedDrupal\webprofiler\Entity\EntityManagerWrapperComment #3
jonathan1055 commentedForgot to ask - what version of Core and Webprofiler/Devel are you using? There is a message about version compatibility on the webprofiler project page.
Comment #4
grahlSorry for not mentioning that, it's core 8.0.6 with devel ca8954d9611ed3f020e66aec0d3a6bf485a494b7
Comment #5
jonathan1055 commentedI confirm that this is a problem with 8.0.4 and 8.0.6 with the devel module from 19th April.
Comment #6
idebr commentedThis is fixed by casting the EntityManager dependency to its interface rather than a specific class, so it becomes swappable. This change is included in the patch at #2867272: Replace all usages of deprecated EntityManager
Comment #7
jonathan1055 commentedThe fix is also included in #2868553: Fix the code to adhere to Drupal Best Practice which is likely to be committed first.
Comment #8
idebr commentedThis was fixed in #2868553: Fix the code to adhere to Drupal Best Practice