Closed GaryReckard closed 2 years ago
I'm also starting to notice this problem. Often the queue does not run and I'm seeing sites with 1k+ queued jobs. If I manually run php craft queue/run
they start processing immediately.
@GaryReckard I'd love to debug this if you still use the plugin.
Hi @ostark I ended up giving the plugin a try in our production environment, and it seems to be working just fine there. Locally, I still experience the issues I described above, but I am currently just disabling async queue in my local environment. Happy to connect to debug.
We run into a similar issue: if we end up with failed jobs after a deployment (e.g. section changed, Craft wants to resave entries, fails for some reason) then manually retrying them makes them sit on pending and they never run. As mentioned in the OP, running the queue test gets it started.
We are noticing this after moving to PHP 8+
Also experiencing this issue since updating Craft to 3.7.34 in the past couple of days.
PHP 7.4 Craft Pro CMS: 3.7.34 Craft Async Queue: 2.3.0
I'll review the changes with Craft 3.7 - maybe I missed something.
@ostark Did you get a chance to review. I am facing the same issue after Craft update to 3.7+.
I managed to get to the bottom of the issue I had and have it working again now. During a Craft update I needed to update my composer.php
to use a PHP version >= 7.3. I then needed to use the PHP_BINARY
.env variable to specify the path to the version of PHP I was using and make sure that the open_basedir
PHP config setting was setup to include that same path. Once everything was configured to use the same version of PHP the Async Queue came back to life.
For context the site we had trouble with was on a server managed through Plesk with multiple other domains hosted and multiple versions of PHP installed.
We have the same problem here. Queue jobs are backing up and there seems to be no way to get them working. runQueueAuomatically
is set to true – still nothing. We only encounter this problem in our live environments, in our dev environments everything seems to work perfectly fine.
PHP: 7.4 Craft Pro CMS: 3.7.32 Async Queue: 2.3.0
Hi All (@sandrodunkel @bhashkar007 @OscarBarrett @mattbloomfield)
1) Can you push a job (e.g. by editing an Entry) and provide these logs?
tail -f storage/logs/console.log | grep argv -C3
tail -f storage/logs/web.log | grep "async-queue"
2) Do you experience the issue when you use the test tool at domain.com/admin/utilities/async-queue-test
3) Is the path to PHP executable correct?
@ostark Same here. Locally with nitro it's working fine. Also on fortrabbit and arcus. However on a host i am using for a staging environment it does stack up processes unless I run it manually.
Try
$(which php) -v
if this is the expected php version, run the following command to get the path to your PHP binary
which php
and assign this path to the PHP_BINARY
ENV var.
FWIW we solved our issues by updating the path to the PHP executable. Sorry for not responding back here.
php -v returns php7 but I am actually using 8. which doesn't seem to work. I am probably just wasting time with that host.
I tried PHP_BINARY="/usr/bin/php8.0"
But this creates an error when I go to the test utility.
is_executable(): open_basedir restriction in effect. File(/usr/bin/php8.0) is not within the allowed path(s):
@pimago Maybe you need to ask the host about the right path and of you are allowed to run php cli commands.
I guess it is the correct path. Because that's how I run successfully
/usr/bin/php8.0 craft queue/run
Or am I confusing that with something else?
Can you try this env var instead?
PHP_PATH=/usr/bin/php8.0
Context: https://github.com/symfony/process/blob/5.4/PhpExecutableFinder.php#L36-L70
Thanks. I tried that. Now the error is
ostark\AsyncQueue\Exceptions\PhpExecutableNotFound Unable to find php executable.
I will ask the host what the correct path might be.
The host did some changes so I can use php8 just with the php command instead of /usr/bin/php8.0 I retried php_path and php_binary with the new path but they still throw me the same errors.
I have installed this plugin, but I am not seeing normal queue jobs getting processed. Purchases in my store should send emails, and those jobs are sitting in the queue. If I run the "Async Queue Test", all of the jobs will then process. But I need these emails to get sent out immediately.
When I tested a 2nd order, I noticed the jobs from the first order got processed, but now my queue has jobs from this 2nd order sitting in the queue.
In my local environment, my
PHP_BINARY
is at/usr/bin/php
, and in production, it is in/usr/local/bin/php
. In both environments, myopen_basedir
is not set to anything.How are the jobs being created during an order handled differently from the Async Queue Test jobs? Why do those get things flowing?
Thanks so much for your help!
Craft CMS: 3.7.24 Craft Async Queue: 2.3 Craft Commerce: 3.4.8