Scheduled posts not publishing

Issue Summary

  • Explain roughly what’s wrong
    I use the official Ghost docker image on my server behind an Nginx proxy using Let’s Encrypt service. After some Ghost update last year, the publishing of schedules posts stopped working. The posts stays in Scheduled status with “published xxx mins ago”.
    When publishing it without schedueling, it works like expected.
  • What did you expect to happen?
    Post should be published, when it is planned.

Steps to Reproduce

  1. Write a post with category and heading image.
  2. Plan post for future (how far in future doesn’t make a difference).
  3. Wait till time is reached and after that.
  4. See post staying in Scheduled category.

Setup information

Ghost Version
5.81

Node.js Version
Official Ghost docker

How did you install Ghost?
Docker with docker-compose behind Nginx proxy and Let’s Encrypt service.

Relevant log / error output

[2024-03-26 02:15:24] ERROR The server has encountered an error.

The server has encountered an error.

Error ID:
    b4c45e40-eb16-11ee-ad98-732507a50e5c

Error Code:
    ETIMEDOUT

----------------------------------------

RequestError: Timeout awaiting 'request' for 5000ms
    at /var/lib/ghost/versions/5.81.0/core/server/adapters/scheduling/scheduling-default.js:319:23
    at ClientRequest.<anonymous> (file:///var/lib/ghost/versions/5.81.0/node_modules/@tryghost/request/node_modules/got/dist/source/core/index.js:792:61)
    at Object.onceWrapper (node:events:632:26)
    at ClientRequest.emit (node:events:529:35)
    at ClientRequest.emit (node:domain:489:12)
    at Socket.socketErrorListener (node:_http_client:501:9)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    at Timeout.timeoutHandler [as _onTimeout] (file:///var/lib/ghost/versions/5.81.0/node_modules/@tryghost/request/node_modules/got/dist/source/core/timed-out.js:42:25)
    at listOnTimeout (node:internal/timers:571:11)
    at process.processTimers (node:internal/timers:512:7)
  • Log when starting Ghost container:
[2024-03-26 02:14:05] INFO Ghost is running in production...
[2024-03-26 02:14:05] INFO Your site is now available on http://kernic.net/
[2024-03-26 02:14:05] INFO Ctrl+C to shut down
[2024-03-26 02:14:05] INFO Ghost server started in 0.812s
[2024-03-26 02:14:05] INFO Database is in a ready state.
[2024-03-26 02:14:05] INFO Ghost database ready in 1.074s
[2024-03-26 02:14:06] WARN Missing mail.from config, falling back to a generated email address. Please update your config file and set a valid from address
[2024-03-26 02:14:07] WARN Theme translations file locales/de.json not found.
[2024-03-26 02:14:07] WARN Theme translations falling back to locales/en.json.
[2024-03-26 02:14:08] INFO Adding offloaded job to the queue
[2024-03-26 02:14:08] INFO Scheduling job mentions-email-report at 37 12 * * * *. Next run on: Tue Mar 26 2024 03:12:37 GMT+0000 (Coordinated Universal Time)
[2024-03-26 02:14:08] INFO Adding offloaded job to the queue
[2024-03-26 02:14:08] INFO Scheduling job clean-expired-comped at 19 28 4 * * *. Next run on: Tue Mar 26 2024 04:28:19 GMT+0000 (Coordinated Universal Time)
[2024-03-26 02:14:08] INFO Adding offloaded job to the queue
[2024-03-26 02:14:08] INFO Scheduling job clean-tokens at 10 42 1 * * *. Next run on: Wed Mar 27 2024 01:42:10 GMT+0000 (Coordinated Universal Time)
[2024-03-26 02:14:08] INFO Ghost URL Service Ready in 4.03s
[2024-03-26 02:14:09] INFO Ghost booted in 4.288s
[2024-03-26 02:14:09] INFO Adding offloaded job to the queue
[2024-03-26 02:14:09] INFO Scheduling job email-analytics-fetch-latest at 42 0/5 * * * *. Next run on: Tue Mar 26 2024 02:15:42 GMT+0000 (Coordinated Universal Time)
[2024-03-26 02:14:09] INFO Adding offloaded job to the queue
[2024-03-26 02:14:09] INFO Scheduling job update-check at 43 8 13 * * *. Next run on: Tue Mar 26 2024 13:08:43 GMT+0000 (Coordinated Universal Time)
[2024-03-26 02:14:09] INFO Running milestone emails job on Tue Mar 26 2024 02:14:09 GMT+0000 (Coordinated Universal Time)

Bump, still found no solution.

You need to work out what in your Docker/network setup is preventing the Ghost process inside the container making network requests to it’s configured URL.

Do you have any clue, what that URL is it want to request?

My assumption is, that there is a problem with http <> https requests.

It will be PUT {your config.url value}/ghost/api/admin/posts/{post_id}/

Weired, then it may isn’t any network related problem, as there are other PUT commands working according to the logs.

[2024-04-03 12:13:01] INFO "PUT /ghost/api/admin/posts/xxx/?formats=mobiledoc%2Clexical&newsletter=default-newsletter&email_segment=all&include=tags%2Cauthors%2Cauthors.roles%2Cemail%2Ctiers%2Cnewsletter%2Ccount.clicks%2Cpost_revisions%2Cpost_revisions.author" 200 170ms

That’s a PUT request from outside of the container. Your network needs to be set up in a way that the process inside the container is able to reach itself via the configured URL.