- Issue created by @vacho
- Status changed to Postponed: needs info
about 1 year ago 11:42pm 23 October 2023 - ๐ญ๐บHungary djg_tram
@vacho -- That's not a solution. This merely silences the error but the worker will never be executed then, given a lease time of nothing.
- ๐ญ๐บHungary djg_tram
@vacho -- Put a dpm() or similar dump into the first line of that function and check
$queue
to see which worker actually causes the problem. Then investigate that worker. I had the same problem and it turned out to be an error in the worker's dependency injection (I'm developing it right now, so it was my error in my case). If it's your code, fix it, if it someone else's, contact them for a fix. As it looks, this isn't a Drupal core issue at all -- as soon as I fixed my own code, it went back to normal.Basically, the first thing to check is whether line 206:
$worker = $this->queueManager->createInstance($queue_name);
can actually instantiate the worker at all. Note that various source sample floating around the web are erronous, if you happen to develop your own worker, be sure to take them with a huge grain of salt.
- Status changed to Needs review
11 months ago 3:59pm 3 January 2024 - ๐บ๐ธUnited States jeffam
I ran across this error while working on some malformed custom queueworker plugins that worked in Drupal 9 but not in Drupal 10.
But perhaps the larger issue is that the warning wasn't logged by Drupal. Without any logs, we didn't know about the issue for some time.
Here's a small patch that logs an error when line 264 in Cron.php fails and sets $lease_time to null.
This can happen if $worker->getPluginDefinition() fails (as it did in my case) or if the 'time' key is missing from the plugin definition.
- Status changed to Needs work
11 months ago 4:24pm 3 January 2024 - ๐บ๐ธUnited States smustgrave
Steps should be added to the issue summary, as well as missing sections.
Changed to 11.x as the current development branch.
Also as a bug will need a test case.
- ๐ซ๐ทFrance zorax Monoblet
I ran into this problem after updating drupal to 10.2.
The patch give me "Missing lease time for cron" in my log.
I created a queue mail function from a sample floating around the web few years ago.
Can you give me an example, link to a custom queueworker plugins which is well configured for 10.2? - last update
10 months ago Custom Commands Failed - ๐ซ๐ทFrance zorax Monoblet
I fixed my problem by reconfiguring the Custom Queue Worker with this example :
https://www.alansaunders.co.uk/blog/queues-drupal-8-and-9 - ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
@zorax: What did you actually change about your queue config?
@zorax Any information please? I hae the same error after upgrading drupal 9 to 10
- ๐บ๐ธUnited States a-fro
@liam-morland this was the same issue with the QueueWorkerPlugin we were using.