Silent failure when sending emails for posts created by API

I created some scheduled posts using the API. Now after one them attempted to send, there’s silent failure with no specific error message in the UI or in the logs.

To start with, here’s what a normal failure-to-send result looks like in the admin UI:

That’s not what happened here. Instead, if you roll over the post in the post list, it says “Sent to members”. But that’s not the normal UX for success either. The normal UX for Success is the message “Sent to 62 members”.

Opening up the post, it reports the same message with the number of users missing:

It shows up in the “Recent Posts” area, but there is no “Sent” or Open Rate" UI even though it was an email-only post:

And this curious: If using the Post filters for “Drafts”, “Scheduled” or “Published”, it doesn’t show up in any category.

I also cannot find anything specific error in the logs around the time email should be sent. Later there’s this generic error message which is not helpful:

[2025-07-19 07:07:06] ERROR Internal Server Error
[2025-07-19 07:07:06] ERROR [EmailAnalytics] Error while fetching
[2025-07-19 07:07:06] ERROR Internal Server Error
[2025-07-19 07:07:06] INFO [EmailAnalytics] No new events found
[2025-07-19 07:07:06] ERROR Error while fetching email analytics Internal Server Error
[2025-07-19 07:07:06] ERROR Internal Server Error

I suspect the issue here is that Ghost expects every email to have email analytics available, but because of the zombie state of this post, it does not have any and this case was not accounted for, resulting in Internal Server Error.

I have about a dozen more scheduled posts created via API the same way, so I’m concerned that without understanding the root cause of this better that none of my posts scheduled for the rest of the year will work.

It seems to me that in one or places there was a data validation failure and when the bad data was attempted to be used, the post got put into an invalid state.

Because there are more scheduled posts that may have this problem, it’s possible that I could provide some kind of database-level export of the tables/rows involved if someone wants to take a look.

I checked on the Mailgun time around the time of the scheduled post and see nothing there.

When I tried duplicating the post and sending today, it worked. That confirms that the flow between Ghost and Mailgun is working fine, and if there was a bad data issue, the duplicate post feature somehow resolved it.

I tried upgrading to 5.130.1, the latest release, and the weird Admin area UX remains: Still showing as “sent” without a particular number of users, but not showing as “Published”. It’s a Heisenpost!

I’m using scheduled posts for event reminders that people depend on for scheduling. Thanks.

Setup information

Ghost Version

5.127.2

Node.js Version
N/A: container

How did you install Ghost?
Official container.

Provide details of your host & operating system
Fedora Linux 41.

Database type
MySQL 8.