Stucked sending emails with large article

Issue Details

I'm experiencing issues with Ghost's email analytics service when sending larger articles (specifically one with 1600 words). While tests with shorter articles send correctly, longer articles trigger the following error in my logs:

TypeError: begin.toISOString is not a function

Technical Information

  • Ghost Version: 5.113.0
  • Domain: https://arcastar.com
  • Server: depro7.fcomet.com

Error Details

The error occurs in the email analytics service and repeats approximately every 5 minutes in the logs. The complete stack trace is:

TypeError: begin.toISOString is not a function
at #fetchEvents (/home/soyedmun/arcastar.com/versions/5.113.0/node_modules/@tryghost/email-analytics-service/lib/EmailAnalyticsService.js:292:64)
at EmailAnalyticsService.fetchMissing (/home/soyedmun/arcastar.com/versions/5.113.0/node_modules/@tryghost/email-analytics-service/lib/EmailAnalyticsService.js:184:39)
at async EmailAnalyticsServiceWrapper.fetchMissing (/home/soyedmun/arcastar.com/versions/5.113.0/core/server/services/email-analytics/EmailAnalyticsServiceWrapper.js:90:29)
at async EmailAnalyticsServiceWrapper.startFetch (/home/soyedmun/arcastar.com/versions/5.113.0/core/server/services/email-analytics/EmailAnalyticsServiceWrapper.js:131:24)
at async /home/soyedmun/arcastar.com/versions/5.113.0/core/server/services/email-analytics/EmailAnalyticsServiceWrapper.js:60:13
at async EventEmitter. (/home/soyedmun/arcastar.com/versions/5.113.0/node_modules/@tryghost/domain-events/lib/DomainEvents.js:34:17)

It appears the service is trying to access a toISOString() method on a begin variable that isn't a valid Date object.

Observed Behavior

  1. Short articles and tests send without issues
  2. When sending a 1600-word article, the system starts showing this error
  3. The error repeats cyclically every 5 minutes in the logs
  4. No visible impact on the user interface, but I'm concerned it's affecting email engagement analytics

Questions

  1. Has anyone else experienced this issue with larger articles?
  2. Is there a solution or patch for this specific error?
  3. Are there any settings I should adjust for email size limits?

I appreciate any guidance on how to fix this issue or whether I should upgrade to a newer Ghost version.

I have only seen this error when using SQLite, instead of MySQL (which I do when developing). Can you please add some more details on how you installed Ghost, specifically including which database?

If you are in fact on SQLite, you should be aware that it isn’t supported in production, and trying to use it for production is not a good idea. There’s a bug that causes deletion of complimentary subscriptions, another that makes date handling weird for posts on the same date, and so on. Because no one runs it in production, those bugs don’t get found and fixed.

If you’re actually just running Ghost locally in development, then yeah, that message is a nuisance but you can just ignore it.

1 Like

You’re right. Is installed on sqlite3… My hosting changed all.

Thanks Cathy.

You should 100% insist on MySQL hosting. Pikapods is a cheap option if you need one

1 Like