• Resolved diegopaz

    (@diegoweb90)


    Hello, maybe you have any idea.
    I have a wordpress version 5.4 in which wp cron does not work, I am clear that you do not solve these types of problems, but I resort to your help based on your plugin that has an unexpected behavior based on this problem.

    When I click the run now button wp-crontrol duplicates the task with date 01-01-1970, and if i edit the duplicated task and set its next execution time to “now” simply dissapear from the list of jobs.
    And of course the jobs never gets executed.
    you have an idea why that may be happening, maybe your comment will help me know where to look, I have already tried:

    – 666 and 777 permissions to the wp-cron.php file
    – disable modsecurity and imunify 360 from cpanel
    – I am under version 7.3 of php, (try 7.1 and 7.2)
    – test with a clean install of wordpress only with wp crontrol installed

    I suspect it is related to hosting, some issue of php based cron execution permissions but they have not yet answered me.

    I want to avoid using a linux cron as I have seen in many forums.

    any help works, thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    When you click “Run now” in Crontrol, what it does is create an exact copy of that event but scheduled for 1970-01-01 at 00:00:01 (1 second into Unix Time).

    This is to ensure that the very next event that fires is the one that you just chose to “Run now”.

    WP Crontrol then manually triggers the cron spawner, which should mean that the event fires even if your cron is otherwise broken. If this is not the case, then your cron is really broken!

    I would suggest checking your PHP error logs to look for fatal errors. Ensure that DEBUG_LOG is enabled and see if any relevant errors appear in your wp-content/debug.log file after attempting to run an event.

    In addition, is WP Crontrol showing any warning about cron not operating correctly?

    Thread Starter diegopaz

    (@diegoweb90)

    Hi John, thanks for your fast reply.
    I have tried that, enable wp debug but no log is generated at all.
    I have setted both directives to wp-config
    Wp debug and wp debug log.

    Wp crontrol not show any error, simply fire the job but never gets executed.

    My hosting is running under litespeed instead of apache, maybe is something wrong with litespeed.

    How other thing can i try?

    The crown spawner maybe calls a some function that is not supoorted by my hosting? But with php error log enabled no error is generated.

    Any ideas will be apreciate

    Thanks

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    The cron system in WordPress is quite simple, it iterates the values in an option and then fires an action with the given name. I don’t believe there’s a whole lot else to it.

    If you’re not seeing any fatal errors then I think the only thing you can do is ask your host for assistance, and if they’re not very helpful then move to another host.

    Thread Starter diegopaz

    (@diegoweb90)

    hi,
    i finally gets the issue solved by the hosting provider, but they never toldme what they did to solve it so…

    but its now working.

    Thanks Jhon for your assistance, great plugin you have made dude!

    Thanks!!

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Glad to hear it, and thanks!

    I’m have the same issue here.
    And the execution when happens in the normal time, the next run is allways put in one hour before the run.
    I have a copy of the WordPress with the same files and database in a homologation server, and that problem is not happening.
    there is no problem reported in the debug.log
    I’m doing a migration to a new server and WordPress version, since the new version upgraded this problem starts.
    Old version :PHP 5.4 and WP 4.8.1 and Now: PHP 7.4 and WP 5.5

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    @fnorte Can you check the Tools -> Site Health screen and see if there’s a warning about your timezone setting?

    If so, there’s some more info here: https://github.com/johnbillion/wp-crontrol/wiki/PHP-default-timezone-is-not-set-to-UTC

    The site health returns no problem at all…
    But I don’t think it’s working properly because the Message: “Results are still loading…” it still there.
    then check the console there is some Javascript problem.

    Uncaught ReferenceError: commonL10n is not defined
        at HTMLDocument.<anonymous> (common.min.js:2)
        at HTMLDocument.dispatch (jquery.js:3)
        at HTMLDocument.r.handle (jquery.js:3)
        at Object.trigger (jquery.js:3)
        at HTMLDocument.<anonymous> (jquery.js:3)
        at Function.each (jquery.js:2)
        at n.fn.init.each (jquery.js:2)
        at n.fn.init.trigger (jquery.js:3)
        at Q (common.min.js:2)
        at HTMLDocument.<anonymous> (common.min.js:2)

    And now I find some Cron error in DEbug too…

    
    [27-Aug-2020 17:11:07 UTC] PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Crontrol\Event\add() must be of the type array, bool given, called in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/wp-crontrol.php on line 160 and defined in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/src/event.php:87
    Stack trace:
    #0 /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/wp-crontrol.php(160): Crontrol\Event\add('2020-08-27 17:4...', '_oneoff', 'wpseo_send_trac...', true)
    #1 /home/html/xxxxxxx/public_html/wp-includes/class-wp-hook.php(287): Crontrol\action_handle_posts('')
    #2 /home/html/xxxxxxx/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #3 /home/html/xxxxxxx/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /home/html/xxxxxxx/public_html/wp-settings.php(546): do_action('init')
    #5 /home/html/xxxxxxx/public_html/wp-config.php(119): require_once('/home/html/xxxx...')
    #6 /home/html/xxxxxxx/public_html/wp-load.php(37): require_once('/home/html/alt in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/src/event.php on line 87
    [27-Aug-2020 17:11:21 UTC] PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Crontrol\Event\add() must be of the type array, bool given, called in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/wp-crontrol.php on line 160 and defined in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/src/event.php:87
    Stack trace:
    #0 /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/wp-crontrol.php(160): Crontrol\Event\add('2020-08-27 17:4...', '_oneoff', 'wpseo_send_trac...', true)
    #1 /home/html/xxxxxxx/public_html/wp-includes/class-wp-hook.php(287): Crontrol\action_handle_posts('')
    #2 /home/html/xxxxxxx/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #3 /home/html/xxxxxxx/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /home/html/xxxxxxx/public_html/wp-settings.php(546): do_action('init')
    #5 /home/html/xxxxxxx/public_html/wp-config.php(119): require_once('/home/html/xxxx...')
    #6 /home/html/xxxxxxx/public_html/wp-load.php(37): require_once('/home/html/alt in /home/html/xxxxxxx/public_html/wp-content/plugins/wp-crontrol/src/event.php on line 87

    And the information about Default Time, all other entries are in my locale, sample :

    [27-Aug-2020 10:43:13 America/Sao_Paulo]

    • This reply was modified 4 years, 6 months ago by fnorte. Reason: missing information

    I’d the downgrade to WordPress 5.4.1 to fix the Site Health problem.
    The site health there is no problem with the UTC.

    @johnbillion – About the UTC
    I compare the 2 servers running (one work and other don’t) the PHP.ini
    Default time zone UTC – Working
    Default time zone America/Sao_Paulo – Not Working

    I put a date_default_timezone_set(‘UTC’); at Wp-config.php
    and the problem still happening

    @johnbillion I trying figured out what is happen and make some test.
    and find some more weird:
    Using the wp-cli cron function at shell.
    Executing ‘wp cron event list’, both servers show the list with the same list showing in the plugin events list.
    Executing a re-schedule of an event:
    The server that works fine, do it fine.
    The server with the problem: “Error: Event not scheduled.”

    There is some reset of the WP-CRON?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Run now button duplicate job with 01-01-1970 date’ is closed to new replies.