Scheduled Posts never publish

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue - https://canadianrealestatenetwork.com
  • What version of Ghost are you using?2.20.1
  • What configuration?Standard
  • What browser?All
  • What errors or information do you see in the console? Scheduled posts never post
  • What steps could someone else take to reproduce the issue you’re having? Create a scheduled post, with default config.

I can see that many people are having issues with Scheduled posts not posting at their scheduled times. Each potential fix appears different and i do ask for help fixing mine. I have read the other posts and tried the suggestions, but i cannot seem to get this fixed.

I do have CDN with Stackpath, not sure if that’s part of the issue. Any help would be great. Please note I am pretty new to this.

What i have found is that if i restart ghost, right before a scheduled post, it will work, but if i set up a bunch of posts and wait, nothing happens.

Hi @scotdill :wave: I’ve seen similar problem popping up a few times as well and would really love to get to the bottom of it :slight_smile: If you could please provide the information answering these questions: #8485 (comment) and #8485 (comment), in this issue - https://github.com/TryGhost/Ghost/issues/8485. If there’s a clear path to reproduce it would gladly reopen the issue and fix this bug :+1: Let me know if you need any help.

Hi,

For #8485

If I set a bunch of articles to publish, they never publish. ( every other day to help with SEO )

Then, if I restart ghost and set them to publish in three min or so, they will publish.

For the second #8485,

My blog is set for EST time zone. I am in EST.

Server is in EST

I am creating 10 or so posts and publishing them every two days.

Not sure what else to say here, nothing is tweaked as far as my ghost files go. I just changed web hosts this week, to create the fasted possible experience ( plus I have other sites… so now have a dedicated server )

So, where im going with this is I have all my server logs, there isn’t too much as it’s a new host, I can send them all in if it will help!

Scott Dillingham

Canadian Real Estate Network – For Investors By Investors

Investor Index - http://www.realestateinvestingnetwork.com/

Blog – http://www.canadianrealestatenetwork.net

View or List Rental Properties for Sale – Free Service - http://www.canadianrealestatenetwork.net/investor-opportunities-forum/

Real Estate Investing Events - http://www.canadianrealestatenetwork.net/calender-of-real-estate-investing-events-in-canada/

Real Estate Professional? Join Us - https://canadian-real-estate-network-2.preview.instantmagazine.com/my-first-group/investor-influence-marketing/directory/

No need to send all the logs just yet, but would be good to know if there’s anything extraordinary happening in logs around publishing time so that the scheduler doesn’t kick in?

I have a few more articles to post.

Ill do them now, and then watch it, and if they are missed ill send the logs for that specific time.

The logs are long as is right now, and I don’t recall the specific times I set the articles to be live… but ill test this for you and record the times so its easy to look up.

Ill respond back in a few days.

Thank you for the help!

Awesome. Hopefully this will shed some light on the issue :+1:

Ok,

I have the log files.

Personally, I don’t see the time stamps, but they just literally failed to publish again. Is there an email or location I can upload the logs?

Hey @scotdill You can send the logs to naz@ghost.org.

If you have any more posts coming in the queue, would be helpful if you could enable debug level of logs to see a little bit more information on when the schedueling is being rung as described here.

I am experiencing very similar issues on our church blog https://blog.fct.church . Some more information bits which might help to shed light on the issue:

  • We have been running on Ghost v2.1.2 for roughly six months and scheduling posts always worked perfectly fine. Problems started to arise after updating to 2.19.3 and did not go away after updating to 2.20.1
  • Based on my observation after a few experiments, scheduled posts are being published when the publish time is in the near future (i.e., not more than a few hours after scheduling). Therefore, I can exclude that it’s an issue with a misconfigured reverse proxy or so, because in that case, scheduling would never work.
  • However, scheduling seems not to work if the publish date is in the “far future”, i.e., roughly more than a day after scheduling. Interestingly, re-scheduling an already scheduled post a few hours before the scheduled publish date (without changing the publish time) will usually make sure that the scheduling works just fine.
  • I somehow did not manage to enable debug logs (I’m using the official Docker image from Dockerhub and therefore do not modify the configuration json file, but setting an environment variable logging__level=debug did not produce more verbose logs). However, adding a few plain console.log statements in SchedulingDefault.js bring me to the conclusion that in the case of failing posts, _addJob is being executed, however, _pingUrl is never reached. For posts scheduled to the “near future”, _pingUrl is triggered as expected and the post is published.

All this somehow leads me to the suspicion that maybe there’s an issue with the scheduling mechanism that is being used in SchedulingDefault.js? However, there has only one commit between 2.1.2 and 2.19.3 that has touched this file, and this is 42c472f and this commit does not touch the general scheduling mechanism as it seems to me. So, the problem is maybe not located in SchedulingDefault.js but somewhere completely different?

Hope that helps to track the issue further down - since we are heavily depending on the scheduling feature in order to schedule posts days or even weeks in advance, I’d really love to see this resolved soon.

@stjosh that’s a very detailed investigation, thank you! The change you have found only does some modifications to the _pingUrl method, but if you are saying it’s never reached it should not be the cause of the problem.

My current suspicion is there’s something going on in _execute method which has a bit complicated timer handling or this block kicks in before the _execute and removes scheduled job from the queue.

Will try setting up a separate instance and schedule some posts for longer than a day in advance. If you have a chance to add more logs to both recursiveRun and _execute function to give more details that would also be great help! Cheers :wink:

@gargol Many thanks for picking this up again! I have now added some more logs to recursiveRun and _execute, although it was a bit hard for me to put log lines to sensible points, since I don’t completely understand how this code is supposed to run. :blush:

What block of code did you want to refer to with your link? The link you posted goes to a commented section… I guess this is not really what you wanted, yes?

Anyway, I’ve added a few more log lines and we have some blog posts scheduled for next Tue, Wed an Thursday. So I should hopefully be able to get back with some more evidence, soon.

Hey @stjosh, updated the link to code, linked to file in the master which was updated earlier today :slight_smile:

One more question about the node version you are running your Ghost instance with. From what I’ve seen the docker image you referred to uses node v10 which was upgraded from v8 in late March, my suspicion is that could have something to do with scheduling as there were no other significant changes to the code itself.

Im using node.js 10 and I am having the same issue, so I do not think it has to do with the node version.

@gargol Thanks for the update! Yes, I thought that this was the block you meant to link, thanks for confirming.

Node Version: Hmm, that‘s an interesting track, indeed! What Node version are you usually using for developing/testing Ghost? What are the officially supported versions? And do you have any clue whether Node‘s timer handling significantly changed from v8 to v10?

@scotdill What @gargol suggests is exactly that Node v10 is creating troubles, since as long I was on Node v8, scheduling never created issues for me…

Ah, sorry, just found the doc on supported Node versions myself :sweat_smile: Link for everyone‘s reference: https://docs.ghost.org/faq/node-versions/

I have scrolled though Node‘s Release Notes a bit, but could not spot anything interesting except a note about warnings for setTimeout in the notes for Node v9, but I don‘t think this is relevant. Also, the v8 Release Notes between v5.8 and v6.6 do not seem to make any suspicious statement in the area of timers.

Maybe a second pair of eyes would spot something more?

Just a thought….

Node 12 is now out. Maybe, if Ghost CMS updates the platform to be compatible with 12 this may fix this issue?

@Kate has taken a look at this issue last Friday and has most likely identified a bug that was causing the behavior in the scheduler. The fix has landed in master today -https://github.com/TryGhost/Ghost/commit/2447335ab16e4e2595a2007fd1aa30217a23fbef , and is planned to be released tomorrow with Ghost 2.22.0 :wink: Would appreciate if you could test it on your environments!

Node 12 is now out. Maybe, if Ghost CMS updates the platform to be compatible with 12 this may fix this issue?

@scotdill the cause seemed to be independent of the Node version. The update in Bookshelf was a reason schedueling stopped working.

2 Likes

@gargol @Kate That’s great news! Many thanks for your investigations and the potential fix. Will upgrade to Ghost 2.22.0 as soon as possible and will let you know whether or not this improves the situation on our end.

2 Likes

That’s great news.

I have about 10 articles to schedule, part of my workload today. Ill set them up and confirm back after the update they work.

( I schedule posts every other day, so ill have 20 days of testing for us )

2 Likes