• Thanks in advance to anyone who takes the time to read this and assist ??

    Around December 10th 2020 automatic plugin updates stopped occurring on both the staging and live site for one of our customers hosted on GoDaddy Managed WordPress. This led me to investigate WP_Cron by installing the WP-Control plugin. Through WP_Control I found that WP_Cron was reporting the below 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:
    Unexpected HTTP response code: 429

    I have been on to GoDaddy support twice, once with a hang-up after 45 minutes and second with a “it’s a content issue” please try contacting WordPress.

    I have tried all the usual troubleshooting; disabled all plugins and reverted to stock theme in staging but no change. I’ve also enabled debug logging but nothing is appearing in the log regards WP_Cron.

    Having done yet more googling, it looks possible that the WP-Control plugin I’m using to monitor WP CRON may not work properly on GoDaddy Managed WordPress – something to do with “Non-standard WP_Cron processes – GoDaddy Managed WordPress runs a central cron service with a different server configuration than the front-facing server”.

    After a day or two of scratching my head I further investigated using the CLI. Manually calling WP-Cron to execute the jobs due to run “now” seems to have worked; however note the 429 error when querying WP-Cron spawn status and the MySQL errors:

    [siteREDACTED@n3nlwpsftp002 html]$ wp cron event list
    +————————————+———————+——————-+—————+
    | hook | next_run_gmt | next_run_relative | recurrence |
    +————————————+———————+——————-+—————+
    | action_scheduler_run_queue | 1970-01-01 00:00:01 | now | Non-repeating |
    | wp_update_plugins | 1970-01-01 00:00:01 | now | Non-repeating |
    | recovery_mode_clean_expired_keys | 1970-01-01 00:00:01 | now | Non-repeating |
    | action_scheduler_run_queue | 2020-12-10 12:12:35 | now | 1 minute |
    | wp_privacy_delete_old_export_files | 2020-12-10 12:58:35 | now | 1 hour |
    | wp_version_check | 2020-12-10 16:58:35 | now | 12 hours |
    | wp_update_plugins | 2020-12-10 16:58:35 | now | 12 hours |
    | wp_update_themes | 2020-12-10 16:58:35 | now | 12 hours |
    | mwp_update_public_keys | 2020-12-11 04:58:19 | now | 1 day |
    | recovery_mode_clean_expired_keys | 2020-12-11 04:58:33 | now | 1 day |
    | wpseo_home_url_check | 2020-12-11 04:58:36 | now | 1 day |
    | flamingo_daily_cron_job | 2020-12-11 04:58:36 | now | 1 day |
    | wp_scheduled_auto_draft_delete | 2020-12-11 09:34:33 | now | 1 day |
    | wpseo-reindex | 2020-12-11 09:51:33 | now | 1 day |
    | wp_scheduled_delete | 2020-12-11 10:05:30 | now | 1 day |
    | delete_expired_transients | 2020-12-11 10:05:30 | now | 1 day |
    | wp_site_health_scheduled_check | 2020-12-13 04:58:35 | now | 1 week |
    | wpseo_ping_search_engines | 2020-12-28 07:08:22 | now | Non-repeating |
    | wpseo_permalink_structure_check | 2021-01-06 18:07:41 | now | 1 day |
    | wpseo_ryte_fetch | 2021-01-06 18:07:41 | now | 1 week |
    | sucuriscan_scheduled_scan | 2021-01-06 18:07:52 | now | 1 day |
    +————————————+———————+——————-+—————+
    [siteREDACTED@n3nlwpsftp002 html]$ wp cron test
    Warning: WP-Cron spawn succeeded but returned HTTP status code: 429 Too Many Requests

    [siteREDACTED@n3nlwpsftp002 html]$ wp cron event run –due-now
    Executed the cron event ‘action_scheduler_run_queue’ in 0.029s.
    Executed the cron event ‘wp_update_plugins’ in 0.962s.
    Executed the cron event ‘recovery_mode_clean_expired_keys’ in 0.002s.
    Executed the cron event ‘action_scheduler_run_queue’ in 0.011s.
    Executed the cron event ‘wp_privacy_delete_old_export_files’ in 0.023s.
    Executed the cron event ‘wp_version_check’ in 2.357s.
    Executed the cron event ‘wp_update_plugins’ in 0.01s.
    Executed the cron event ‘wp_update_themes’ in 0.007s.
    Executed the cron event ‘mwp_update_public_keys’ in 0.158s.
    Executed the cron event ‘recovery_mode_clean_expired_keys’ in 0.003s.
    Executed the cron event ‘wpseo_home_url_check’ in 0.003s.
    Executed the cron event ‘flamingo_daily_cron_job’ in 8.898s.
    Executed the cron event ‘wp_scheduled_auto_draft_delete’ in 0.112s.
    Executed the cron event ‘wpseo-reindex’ in 0.004s.
    Executed the cron event ‘wp_scheduled_delete’ in 7.748s.
    Executed the cron event ‘delete_expired_transients’ in 0.009s.
    Executed the cron event ‘wp_site_health_scheduled_check’ in 3.063s.
    Executed the cron event ‘wpseo_ping_search_engines’ in 0.002s.
    Executed the cron event ‘wpseo_permalink_structure_check’ in 0.006s.
    Executed the cron event ‘wpseo_ryte_fetch’ in 5.017s.
    Executed the cron event ‘sucuriscan_scheduled_scan’ in 130.932s.
    Success: Executed a total of 21 cron events.

    Warning: mysqli_query(): MySQL server has gone away in /home/z47dREDACTED392/html/wp-includes/wp-db.php on line 205 6
    Warning: mysqli_query(): Error reading result set’s header in /home/z47dREDACTED392/html/wp-includes/wp-db.php on l ine 2056

    After doing this I had hoped all would be well as WP_Control plugin was now showing all the jobs had run, however the next day I took a look and all the jobs that should have run again had not and were reporting “missed schedule”.

    Hoping someone can help me here as this is driving me a little nuts ??

    • This topic was modified 3 years, 10 months ago by finiterex.
Viewing 15 replies - 1 through 15 (of 19 total)
  • > Hoping someone can help me here as this is driving me a little nuts ??

    Ya. GoDaddy does that to people, and they don’t even have to try that hard.

    Without even reading their docs, I’m sure that there are server limitations coming from GoDaddy hosting.

    If you can, disable the wp cron in the config file, and just use your server cron :
    https://kinsta.com/knowledgebase/disable-wp-cron/
    https://ca.godaddy.com/help/create-cron-jobs-16086

    Here is a good thread :
    https://ca.godaddy.com/community/Using-WordPress/Wordpress-Wp-cron-editing/td-p/7043

    I would also write some perl, or using an external service like this :
    https://www.setcronjob.com/
    just to see if the job finishes, or comes back with more verbose errors.

    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso

    Unfortunately GoDaddy Managed WordPress has no CPanel so the first two links are not going to help (I’d already been down this avenue).

    The third link you provided (https://ca.godaddy.com/community/Using-WordPress/Wordpress-Wp-cron-editing/td-p/7043), I will give this a go – “Solution Two – External Cron Job Server. The better, cleaner and more controlled way to make the cron job queue work is to use an external cron job server to fire things off every xx minutes.”

    Albeit the above is a workaround to the problem; I still need to know why this problem is occuring!

    imo I would also blame GoDaddy.

    > I still need to know why this problem is occuring!

    I think it’s a memory / resource issue.
    Migrate the site locally on XAMPP or MAMP and test the cron – or if you have a development URL and hosting you can use on a different host.

    That would be my first step – it would indicate whether or not I have to go further down a GoDaddy rabbit hole.

    Thread Starter finiterex

    (@finiterex)

    Thanks for the suggestion but I am not sure that is an option for me due to time constraints. Is there no logging or other areas of WordPress I can look at for further info?

    You can see if any of the plugins you have installed have verbose logging.
    You can go through this process to catch errors and read error logs :

    Debugging in WordPress

    Since you can kick off the cron manually, deactivate all your plugins, and add them back in one by one and running the cron in between.

    The error is not “obvious” – you’ll need to put in the investigative effort.

    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso – when you say “kick off the cron manually” in which way should I trigger it? I’m really confused because I can run the WP_Cron jobs from the CLI using WP CRON EVENT RUN –DUE-NOW but the jobs wont manually run any other way (e.g. from WP-Control plugin) / aren’t ever triggered to run automatically… I am very lost!

    What I’m suggesting – is that you get your cron list as you have above, then run each cron individually to see if one of them errors out or not, like this for example I’m running the index from the Yoast plugin :

    kerryfox@usm18 [~/public_html]# wp cron event run wpseo-reindex
    Executed the cron event 'wpseo-reindex' in 0.006s.
    Success: Executed a total of 1 cron event.
    kerryfox@usm18 [~/public_html]#
    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso

    OK understand. When I run each job from the CLI they all report “Success: Executed a total of 1 cron event.” with no errors appearing in the debug.log file.

    This is why I am so totally confused – jobs execute fine from the CLI, but do not execute automatically (all miss schedule) and don’t execute successfully if I try to run from WP-Control.

    Confused ??

    I dunno what else to say.

    Escalate at GoDaddy, or move hosts.

    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso

    I’m going to give it a go running each one manually and seeing what results I get. I’m then going to try what was suggested in one of the posts you provided; manually trigger WP_Cron with an external HTTP GET. If the result of the later test is things still not working I’m going back to GoDaddy to push harder.

    A massive thank you for your help.

    Good plan.
    Best of luck with GoDaddy. They are generally awful.

    Thread Starter finiterex

    (@finiterex)

    Hey @corrinarusso

    So I manually ran each job from the CLI with no issue… but still the jobs are not auto triggering. Even when I tried going to https://www.yourwebsite.com/wp-cron.php?doing_wp_cron/?nocache=1 (or the HTTPS version) the WP_Cron jobs didn’t trigger.

    Below is the output of manually running each job from the CLI. I’m now back on the phone with GoDaddy… wish me luck!

    [REDACTED@n3nlwpsftp002 html]$ wp cron event list
    +————————————+———————+——————-+————+
    | hook | next_run_gmt | next_run_relative | recurrence |
    +————————————+———————+——————-+————+
    | action_scheduler_run_queue | 2021-01-08 13:35:35 | now | 1 minute |
    | wp_privacy_delete_old_export_files | 2021-01-08 13:58:35 | now | 1 hour |
    | wp_version_check | 2021-01-08 16:58:35 | now | 12 hours |
    | wp_update_plugins | 2021-01-08 16:58:35 | now | 12 hours |
    | wpseo_permalink_structure_check | 2021-01-08 18:07:41 | now | 1 day |
    | sucuriscan_scheduled_scan | 2021-01-08 18:07:52 | now | 1 day |
    | wp_update_themes | 2021-01-09 01:25:42 | now | 12 hours |
    | mwp_update_public_keys | 2021-01-09 04:58:19 | now | 1 day |
    | recovery_mode_clean_expired_keys | 2021-01-09 04:58:33 | now | 1 day |
    | wpseo_home_url_check | 2021-01-09 04:58:36 | now | 1 day |
    | flamingo_daily_cron_job | 2021-01-09 04:58:36 | now | 1 day |
    | wp_scheduled_auto_draft_delete | 2021-01-09 09:34:33 | now | 1 day |
    | wpseo-reindex | 2021-01-09 09:51:33 | now | 1 day |
    | wp_scheduled_delete | 2021-01-09 10:05:30 | now | 1 day |
    | delete_expired_transients | 2021-01-09 10:05:30 | now | 1 day |
    | wp_site_health_scheduled_check | 2021-01-10 04:58:35 | now | 1 week |
    | wpseo_ryte_fetch | 2021-01-13 18:07:41 | 2 days 8 hours | 1 week |
    +————————————+———————+——————-+————+

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_privacy_delete_old_export_files
    Executed the cron event ‘wp_privacy_delete_old_export_files’ in 0.018s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_version_check
    Executed the cron event ‘wp_version_check’ in 1.93s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp_update_plugins
    bash: wp_update_plugins: command not found

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_update_plugins
    Executed the cron event ‘wp_update_plugins’ in 0.048s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wpseo_permalink_structure_check
    Executed the cron event ‘wpseo_permalink_structure_check’ in 0.008s.
    Success: Executed a total of 1 cron event.

    Executed the cron event ‘sucuriscan_scheduled_scan’ in 128.4s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_update_themes
    Executed the cron event ‘wp_update_themes’ in 0.052s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run mwp_update_public_keys
    Executed the cron event ‘mwp_update_public_keys’ in 0.054s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run recovery_mode_clean_expired_keys
    Executed the cron event ‘recovery_mode_clean_expired_keys’ in 0.005s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wpseo_home_url_check
    Executed the cron event ‘wpseo_home_url_check’ in 0.006s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run flamingo_daily_cron_job
    Executed the cron event ‘flamingo_daily_cron_job’ in 1.607s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_scheduled_auto_draft_delete
    Executed the cron event ‘wp_scheduled_auto_draft_delete’ in 0.006s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wpseo-reindex
    Executed the cron event ‘wpseo-reindex’ in 0.005s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_scheduled_delete
    Executed the cron event ‘wp_scheduled_delete’ in 0.011s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run delete_expired_transients
    Executed the cron event ‘delete_expired_transients’ in 0.009s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wp_site_health_scheduled_check
    Executed the cron event ‘wp_site_health_scheduled_check’ in 4.571s.
    Success: Executed a total of 1 cron event.

    [REDACTED@n3nlwpsftp002 html]$ wp cron event run wpseo_ryte_fetch
    Executed the cron event ‘wpseo_ryte_fetch’ in 2.595s.
    Success: Executed a total of 1 cron event.

    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso,

    GoDaddy support have had me add the following to the WP-config.php file:
    /** GoDaddy CRON Fix */
    if(!defined(‘WP_CRON_CUSTOM_HTTP_BASIC_USERNAME’)) { define(‘WP_CRON_CUSTOM_HTTP_BASIC_USERNAME’, ‘YOUR_USERNAME_HERE’); } if(!defined(‘WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD’)) { define(‘WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD’, ‘YOUR_PASSWORD_HERE’); }

    In addition they’ve had me the mu-plugin from the following GitHub: https://gist.github.com/nickohrn/0fd65917057e579a6a97. This is just a single php file called http-basic-cron-request.php that contains:

    <?php

    if(defined(‘WP_CRON_CUSTOM_HTTP_BASIC_USERNAME’) && defined(‘WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD’)) {
    function http_basic_cron_request($cron_request) {
    $headers = array(‘Authorization’ => sprintf(‘Basic %s’, base64_encode(WP_CRON_CUSTOM_HTTP_BASIC_USERNAME . ‘:’ . WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD)));

    $cron_request[‘args’][‘headers’] = isset($cron_request[‘args’][‘headers’]) ? array_merge($cron_request[‘args’][‘headers’], $headers) : $headers;

    return $cron_request;
    }

    add_filter(‘cron_request’, ‘http_basic_cron_request’);
    }

    I have very little idea what these files do, but am told to wait for the WP_Cron jobs to see if they trigger and go from there.

    Any idea what these do?

    I’ve not seen this before, but it seems clear it is passing in direct authorization.
    I guess this would be useful if the user who installed WordPress does not have the right permissions based on the owner and group of the cron.

    Can you type this on your ssh terminal :
    @usm18 [~/public_html/]# id
    and then :
    @usm18 [~/public_html/]# crontab -l

    Thread Starter finiterex

    (@finiterex)

    Hi @corrinarusso,

    My html path appears to be /home/sitename/html so I’ve used that.

    gid=100450(inetuser) groups=100450(inetuser)
    crontab -l
    bash: crontab: command not found

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘WP_Cron HTTP 429 Error’ is closed to new replies.