WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 4 weeks ago

#39340 new defect (bug)

Scheduled Posts are being missed (problem with wp-cron.php?)

Reported by: remarkablemike Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.6.1
Component: Cron API Keywords:
Focuses: Cc:
PR Number:

Description

Scheduled posts are missing their set time. This is not an issue with out server times, nor is it an issue with the cron jobs.

I have seen that many other users are experiencing problems with this, but as of yet there has been no word from WordPress.

Has this been fixed in 4.7? Or is this still outstanding?

Attachments (2)

20170212_1315_CronManager_p1.png (67.2 KB) - added by daviding 3 years ago.
WPX Cron Manager Light p1 showing wp_version_check 13 days late
20170212_1315_CronManager_p3.png (61.1 KB) - added by daviding 3 years ago.
WPX Cron Manager Light p3 showing lifestream_cron reset, but it doesn't run

Download all attachments as: .zip

Change History (8)

#1 in reply to: ↑ description @edent
3 years ago

Replying to remarkablemike:

Has this been fixed in 4.7? Or is this still outstanding?

I have this problem with 4.7–en_GB.

I've tried using Alternative_Cron, disabling plugins, disabling Cloudflare, and manually visiting pages during scheduled times - but it still doesn't work.

Other cron jobs work on my server.

Given the large numbers of people having this problem, and the popularity of plugins which claim to solve this issue, I suspect it is a fundamental flaw with how WordPress works.

As per https://developer.wordpress.org/plugins/cron/

WP-Cron will run tasks regardless of how old they are. Tasks will sit in a queue until a page is loaded to trigger them, thus no task will ever be lost.

This is now demonstrably false.

My suspicion is that wp-cron is failing in an unspecified way. There was a proposal to display detailed error messages - but it was abandoned #23133

Using get_cron_array(), I can see that future posts are being placed in the schedule:

[1484813336] => Array
        (
            [publish_future_post] => Array
                (
                    [0da9aa88af9739142d6b46c1ce06de2d] => Array
                        (
                            [schedule] => 
                            [args] => Array
                                (
                                    [0] => 24563
                                )

                        )

                )

        )

I wonder if there's a problem with the schedule there? Other jobs look like this

[1484187126] => Array
        (
            [jetpack_v2_heartbeat] => Array
                (
                    [40cd750bba9870f18aada2478b24840a] => Array
                        (
                            [schedule] => daily
                            [args] => Array
                                (
                                )

                            [interval] => 86400
                        )

                )

        )

I don't *think* that there should be a schedule for one off events like posting a blog, but I can't be sure.

Last edited 3 years ago by SergeyBiryukov (previous) (diff)

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Cron API

@daviding
3 years ago

WPX Cron Manager Light p1 showing wp_version_check 13 days late

@daviding
3 years ago

WPX Cron Manager Light p3 showing lifestream_cron reset, but it doesn't run

#3 follow-up: @daviding
3 years ago

  • Summary changed from Scheduled Posts are being missed to Scheduled Posts are being missed (problem with wp-cron.php?)

It's possible that I might have a related problem. I recently moved web hosting providers, and am having a problem that the cron for the wp-lifestream plugin isn't working. However, I have now installed the WPX Cron Manager Light plugin, and there are many other plugins that aren't working. I have attached some screen captures from WPX Cron Manager.

On page 1, wp_version_check is listed as 13 days late.

https://core.trac.wordpress.org/attachment/ticket/39340/20170212_1315_CronManager_p1.png

I have pushed the "Execute Now" for lifestream_cron, which updates the timer, but the actual cron has not created any updates.

https://core.trac.wordpress.org/attachment/ticket/39340/20170212_1315_CronManager_p3.png

I am running Wordpress 4.7.2.

In wp-config.php, I have tried setting ALTERNATE_WP_CRON as directed at https://codex.wordpress.org/Editing_wp-config.php#Alternative_Cron , but this doesn't not seem to help.

If someone would like to suggest additional diagnostic steps, they would be welcomed.

#4 in reply to: ↑ 3 @vonkoga
3 years ago

I had the same problem, and figured out that due to server resource overload, hoster disabled cron automaticaly because it sensed a security issue. You should fix your webpage serving issue, and optimize it more efficiently, or transfer to more resourceful hosting package.

Replying to daviding:

It's possible that I might have a related problem. I recently moved web hosting providers, and am having a problem that the cron for the wp-lifestream plugin isn't working. However, I have now installed the WPX Cron Manager Light plugin, and there are many other plugins that aren't working. I have attached some screen captures from WPX Cron Manager.

On page 1, wp_version_check is listed as 13 days late.

https://core.trac.wordpress.org/attachment/ticket/39340/20170212_1315_CronManager_p1.png

I have pushed the "Execute Now" for lifestream_cron, which updates the timer, but the actual cron has not created any updates.

https://core.trac.wordpress.org/attachment/ticket/39340/20170212_1315_CronManager_p3.png

I am running Wordpress 4.7.2.

In wp-config.php, I have tried setting ALTERNATE_WP_CRON as directed at https://codex.wordpress.org/Editing_wp-config.php#Alternative_Cron , but this doesn't not seem to help.

If someone would like to suggest additional diagnostic steps, they would be welcomed.

#5 @daviding
3 years ago

@vonkoga Thanks for the followup.

I worked with my web provider (PlanetHoster), disabled the Wordpress virtual cron, and created the cron in cPanel. The instructions varied a little bit from https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/wordpress2/configuring-a-cron-job-for-wordpress , but that's the general idea.

My problem wasn't a server resource overload. My shared web hosting comes with 4GB of RAM (!) and it typically runs at less than half of that, across multiple web domains. I still haven't got a definitive diagnosis of the problem, but have dissolved it by configuring in cPanel.

#6 @archon810
4 weeks ago

WP's problem with posting scheduled posts reliably, even if they're slightly late - better a bit late than never or really late - has been plaguing it for years. It's time to resolve it.

Numerous solutions have been created, but they're all bloated or use up too many resources (such as checking on every page load):

https://github.com/sLaNGjI/wp-missed-schedule

https://wordpress.org/plugins/scheduled-post-trigger/
https://wordpress.org/support/topic/switch-logic-to-wp-cron/

etc.

Can WP just sort this out so it's not a problem almost every day?

Thanks.

Note: See TracTickets for help on using tickets.