I’m attempting to use the Control plugin so I can force Cron jobs to run while debugging locally. However, when I load up the admin page, I’m greeted with the following error:
There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
cURL error 28: Operation timed out after 3001 milliseconds with 0 bytes received
I’ve attempted to restart the site to no avail.
Any feedback on how to fix this?
The cURL error usually pops up when when an HTTP GET request times out. If you install the Query Monitor plugin you will be able to see what HTTP request is timing out.
If you want to run an WP-Cron events that are due you can go to Local’s SSH of the site and enter the following,
wp cron event run --due-now
Thanks for the reply and suggstion to use wp-cli. From my understanding, there is no way to force an event to run with wp-cli, am I missing something?
That’s what I use the Crontrol for. If you know of a way to force an event to run via cli or otherwise, let me know.
Using the above wp-cli command will run any due events. It’s not forcing the event to run, but because you’re using wp-cli you wont see any timeout issues.
I think what I was looking for is:
wp cron event run <hook>
which will force the event with
<hook> to run immediately. The
--due-now tag will only run those that are due at the time of running the command.
While this doesn’t solve the initial problem, it’s a reasonable work around (though I haven’t tested yet). Thanks for the help.
@clay Any ideas here? The issue with using WP-CLI is that I can’t troubleshoot/stop the code (or don’t know how) using PHPStorm. When using Crontrol, when I force a cron job to start, I’m able to catch the execution of the code and walk through it to see where/if things are breaking.