Failed to send magic link email Error when trying to sign up

This worked for me. Ironically, I think the order matters here, since I had all the same information as you @mjw but in a different order within the JSON. Once I copied your template into my configuration and edited with the info specific to my Mailgun account, it worked like a charm.

Thank you so much!

1 Like

Sorry to bring up a quasi dead post, but how would you have this added in your docker/docker-compose? I have a bunch of mail_options in my compose file, but it looks like those were ignored when I look at my config.prod.

See this post:

See I have that, but the config.production file just has “Direct” and it gives me a magic link error when someone attempts to subscribe.

Please remember to NOT Reply All when replying to this email.

IIRC, and I don’t use Docker for Ghost, config.production.json isn’t used by Docker; you have to pass the relevant environment variables for your setup.

This is a thread on a public forum, not an email conversation.

Hello, I got exactly the same error but in my case, it’s because I’m using a free account.

In /var/www/my-super-blog-on-top, I ran this command:

journalctl -fu '*ghost*'

Then, I tried to generate a magic link once again and got these logs:

Jan 04 08:45:08 vps-290d48db node[133743]: [2024-01-04 08:45:08] ERROR Failed to send email. Reason: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings..
Jan 04 08:45:08 vps-290d48db node[133743]:
Jan 04 08:45:08 vps-290d48db node[133743]: Failed to send email. Reason: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings..
Jan 04 08:45:08 vps-290d48db node[133743]: "Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
Jan 04 08:45:08 vps-290d48db node[133743]: Error ID:
Jan 04 08:45:08 vps-290d48db node[133743]:     9046afb0-aadd-11ee-96b4-45ad56f06527
Jan 04 08:45:08 vps-290d48db node[133743]: Error Code:
Jan 04 08:45:08 vps-290d48db node[133743]:     EENVELOPE
Jan 04 08:45:08 vps-290d48db node[133743]: ----------------------------------------
Jan 04 08:45:08 vps-290d48db node[133743]: Error: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.
.
.
.
Jan 04 08:45:08 vps-290d48db node[133743]: [2024-01-04 08:45:08] INFO "POST /members/api/send-magic-link/" 400 404ms

This is pretty explicit. However, it’s sad because I just started my blog and can’t afford the Foundation offer, but that’s another subject.

I hope it helps!

(ps: it’s been 11 months since the last reply was written. I was facing the same error, but not for the same reason that I couldn’t solve for hours. I wanted to share it, sorry if it was not appropriate.)

Edit: I don’t know why but the “reset password” email is still being sent + I found a solution thanks to @jannis !

Have a look here: How to Downgrade to the Flex Plan in Mailgun in 2023

2 Likes

Thank you so much, I also started a self-hosting plan with Digital Ocean and the official guides are not working for the email part.

They should update the docs.

Also I had issues with free RAM (1GB was consuming too rapidly) and hopefully I solved thanks to this amazing forum

Worked like a charm. Thank you! I think this configuration should be included in documentation.

1 Like

I have tried it all. using docker.compose file
tried port 587 and 465, tried setting mail__options__secure: false & true
tried setting mail__options__auth__pass: as the API key and the smtp password.
i continue getting the error magiclink failed to send
Any ideas of what i can do next?
thanks

What do the error logs say?

Is it possible you need the .eu version of mailgun’s server address and don’t have it (or the opposite)?

Would using eu vs US make a difference? Mailgun is working with my Gmail email

My docker log

root@localhost:~/ghost# docker logs 8af9d7d636c7

[2024-11-10 10:10:39] INFO Ghost is running in production…

[2024-11-10 10:10:39] INFO Your site is now available on https://blog.mediatechsolutions.live/

[2024-11-10 10:10:39] INFO Ctrl+C to shut down

[2024-11-10 10:10:39] INFO Ghost server started in 0.94s

[2024-11-10 10:10:39] INFO Database is in a ready state.

[2024-11-10 10:10:39] INFO Ghost database ready in 1.294s

[2024-11-10 10:10:42] INFO Adding offloaded job to the queue

[2024-11-10 10:10:42] INFO Scheduling job mentions-email-report at 17 50 * * * *. Next run on: Sun Nov 10 2024 10:50:17 GMT+0000 (Coordinated Universal Time)

[2024-11-10 10:10:43] INFO Ghost URL Service Ready in 4.554s

[2024-11-10 10:10:43] INFO Adding offloaded job to the queue

[2024-11-10 10:10:43] INFO Scheduling job clean-expired-comped at 3 17 1 * * *. Next run on: Mon Nov 11 2024 01:17:03 GMT+0000 (Coordinated Universal Time)

[2024-11-10 10:10:43] INFO Adding offloaded job to the queue

[2024-11-10 10:10:43] INFO Scheduling job clean-tokens at 40 8 17 * * *. Next run on: Sun Nov 10 2024 17:08:40 GMT+0000 (Coordinated Universal Time)

[2024-11-10 10:10:43] INFO Ghost booted in 4.689s

[2024-11-10 10:10:43] INFO “GET /favicon.ico” 302 9ms

[2024-11-10 10:10:43] INFO Adding offloaded job to the queue

[2024-11-10 10:10:43] INFO Scheduling job update-check at 44 11 3 * * *. Next run on: Mon Nov 11 2024 03:11:44 GMT+0000 (Coordinated Universal Time)

[2024-11-10 10:10:43] INFO Running milestone emails job on Mon Nov 11 2024 10:10:43 GMT+0000 (Coordinated Universal Time)

[2024-11-10 10:10:47] INFO “GET /ghost/” 200 71ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/users/me/?include=roles” 200 1016ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/site/” 200 5ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/config/” 200 12ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/tiers/?filter=type%3Apaid%2Bactive%3Atrue&limit=all” 200 131ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations%2Crecommendations” 200 135ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/themes/active/” 200 36ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/notifications/” 200 39ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/site/” 200 3ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/config/” 200 21ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations” 200 47ms

[2024-11-10 10:10:48] INFO “GET /ghost/api/admin/users/me/?include=roles” 200 45ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/invites/” 200 154ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/tiers/” 200 140ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/stats/referrers/” 200 160ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/recommendations/?include=count.clicks%2Ccount.subscribers&order=created_at+desc&limit=5” 200 175ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/incoming_recommendations/?limit=5&order=created_at+desc” 200 163ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/users/?limit=100&include=roles” 200 192ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/roles/?limit=all” 200 160ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/integrations/?include=api_keys%2Cwebhooks” 200 185ms

[2024-11-10 10:10:49] INFO “GET /ghost/api/admin/newsletters/?include=count.active_members%2Ccount.posts&limit=50” 200 192ms

[2024-11-10 10:10:52] INFO “GET /ghost/api/admin/members/?order=id&limit=1&page=1&include=newsletters%2Clabels” 200 29ms

[2024-11-10 10:10:55] INFO “GET /?v=1731233464377” 200 257ms

[2024-11-10 10:10:55] INFO “GET /assets/built/screen.css?v=d4ad3af54e” 200 8ms

[2024-11-10 10:10:55] INFO “GET /public/cards.min.css?v=d4ad3af54e” 200 11ms

[2024-11-10 10:10:55] INFO “GET /assets/built/main.min.js?v=d4ad3af54e” 200 11ms

[2024-11-10 10:10:55] INFO “GET /public/cards.min.js?v=d4ad3af54e” 200 5ms

[2024-11-10 10:10:55] INFO “GET /public/member-attribution.min.js?v=d4ad3af54e” 200 4ms

[2024-11-10 10:10:55] INFO “GET /public/comment-counts.min.js?v=d4ad3af54e” 200 2ms

[2024-11-10 10:10:55] INFO “GET /members/api/member/” 204 13ms

[2024-11-10 10:10:55] INFO “GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a” 304 9ms

[2024-11-10 10:10:55] INFO “GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits” 304 41ms

[2024-11-10 10:10:55] INFO “GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all” 304 20ms

[2024-11-10 10:10:55] INFO “GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all” 304 30ms

[2024-11-10 10:11:03] INFO “GET /” 200 55ms

[2024-11-10 10:11:04] INFO “GET /members/api/member/” 204 1ms

[2024-11-10 10:11:04] INFO “GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a” 304 4ms

[2024-11-10 10:11:04] INFO “GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all” 304 20ms

[2024-11-10 10:11:04] INFO “GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits” 304 20ms

[2024-11-10 10:11:04] INFO “GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all” 304 22ms

[2024-11-10 10:11:28] INFO “GET /members/api/integrity-token/” 200 2ms

[2024-11-10 10:12:59] INFO “POST /members/api/send-magic-link/” 200 90001ms

[2024-11-10 10:13:24] INFO [Recommendations] Updating recommendations metadata

[2024-11-10 10:13:29] ERROR Failed to send email. Reason: Connection timeout.

Failed to send email. Reason: Connection timeout.

“Please see Configuration - Adapt your publication to suit your needs for instructions on configuring email.”

Error ID:

6e8fe670-9f4c-11ef-95a7-319855df66f8

Error Code:

ETIMEDOUT


Error: Connection timeout

at createMailError (/var/lib/ghost/versions/5.95.0/core/server/services/mail/GhostMailer.js:105:12)

at SMTPConnection._formatError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)

at SMTPConnection._onError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:793:20)

at Timeout. (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:237:22)

at listOnTimeout (node:internal/timers:569:17)

at process.processTimers (node:internal/timers:512:7)

[2024-11-10 10:14:14] INFO Updating incoming recommendations on boot

root@localhost:~/ghost#

OK, so that. It’s not a password problem, it’s a never-gets-a-response problem.

Yes. Mailgun offers both types of accounts, and if you try to use the server name for the other account location, it fails. (Although I think it fails with a ‘bad password’ error, not timeout.)

Are you sure the container has access to mailgun? Any chance something is blocking the port?

Might be good idea to post the docker compose file - perhaps one of the docker pros will spot your problem. :slight_smile:

You’re probably already aware (from earlier in the thread), but just in case you missed it: docker setups usually use environment variables to configure mail, not config.production.json. Pikapods (which is docker containers) has good instructions for what works, and I’m using those configs with mailgun to get transactional email from Ghost: Ghost | PikaPods Docs (scroll down to transactional email)

My Docker compose: please, does anyone see any issues with this docker compose file.
Issue: the subscribe option to my ghost site does not work. Failed to send magic link, the docker log is above ib the previous post
Any help is appreciated. Thank you!

version: '3.1'

services:

  ghost:
    image: ghost:5-alpine
    restart: always
    ports:
      - 8585:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, and is likely wrong for your environment!
      url: https://blog.mediatechsolutions.live
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to b>
      #NODE_ENV: development
    # Mailgun Configuration
      mail__transport: SMTP
      mail__options__service: Mailgun
      mail__options__host: smtp.mailgun.org
      mail__options__port: 587
      mail__options__secure: false
      mail__options__auth__user: "postmaster@mail.mediatechsolutions.live"
      mail__options__auth__pass: "password"
      mail__from: "noreply@mail.mediatechsolutions.live"
      # Enable Debug Logging
      logging__level: debug
    volumes:
      - ghost:/var/lib/ghost/content

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

Also just cleared all firewalls on my Linode Ubuntu server where i have the ghost docker running just to be sure there is nothing blocking it.
Still no luck with site visitor subscribing.
Error: Failed to send magic link email

I have also just tried telnet smtp.us.mailgun.org 587 and this does not work. No idea why.

My latest docker log: Any ideas please? thank you!

root@localhost:~/ghost# docker log 06de3f6ec88b
docker: 'log' is not a docker command.
See 'docker --help'
root@localhost:~/ghost# docker logs 06de3f6ec88b
[2024-11-10 10:45:09] INFO Ghost is running in production...
[2024-11-10 10:45:09] INFO Your site is now available on https://blog.mediatechsolutions.live/
[2024-11-10 10:45:09] INFO Ctrl+C to shut down
[2024-11-10 10:45:09] INFO Ghost server started in 0.982s
[2024-11-10 10:45:09] INFO Database is in a ready state.
[2024-11-10 10:45:09] INFO Ghost database ready in 1.303s
[2024-11-10 10:45:11] INFO Adding offloaded job to the queue
[2024-11-10 10:45:11] INFO Scheduling job mentions-email-report at 23 30 * * * *. Next run on: Sun Nov 10 2024 11:30:23 GMT+0000 (Coordinated Universal Time)
[2024-11-10 10:45:12] INFO Adding offloaded job to the queue
[2024-11-10 10:45:12] INFO Scheduling job clean-expired-comped at 23 47 1 * * *. Next run on: Mon Nov 11 2024 01:47:23 GMT+0000 (Coordinated Universal Time)
[2024-11-10 10:45:12] INFO Adding offloaded job to the queue
[2024-11-10 10:45:12] INFO Scheduling job clean-tokens at 41 40 14 * * *. Next run on: Sun Nov 10 2024 14:40:41 GMT+0000 (Coordinated Universal Time)
[2024-11-10 10:45:12] INFO Ghost booted in 4.553s
[2024-11-10 10:45:12] INFO Ghost URL Service Ready in 4.556s
[2024-11-10 10:45:12] INFO Adding offloaded job to the queue
[2024-11-10 10:45:12] INFO Scheduling job update-check at 21 0 5 * * *. Next run on: Mon Nov 11 2024 05:00:21 GMT+0000 (Coordinated Universal Time)
[2024-11-10 10:45:12] INFO Running milestone emails job on Tue Nov 12 2024 10:45:12 GMT+0000 (Coordinated Universal Time)
[2024-11-10 10:45:14] INFO "GET /ghost/" 200 88ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 1016ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/site/" 200 5ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/config/" 200 10ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/tiers/?filter=type%3Apaid%2Bactive%3Atrue&limit=all" 200 138ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations%2Crecommendations" 200 143ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/notifications/" 200 30ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/themes/active/" 200 41ms
[2024-11-10 10:45:16] INFO "GET /?v=1731235525494" 200 265ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/admin/members/?order=id&limit=1&page=1&include=newsletters%2Clabels" 200 248ms
[2024-11-10 10:45:16] INFO "GET /assets/built/screen.css?v=97385424dc" 200 6ms
[2024-11-10 10:45:16] INFO "GET /public/cards.min.css?v=97385424dc" 200 7ms
[2024-11-10 10:45:16] INFO "GET /assets/built/main.min.js?v=97385424dc" 200 6ms
[2024-11-10 10:45:16] INFO "GET /public/member-attribution.min.js?v=97385424dc" 200 6ms
[2024-11-10 10:45:16] INFO "GET /public/comment-counts.min.js?v=97385424dc" 200 8ms
[2024-11-10 10:45:16] INFO "GET /public/cards.min.js?v=97385424dc" 200 7ms
[2024-11-10 10:45:16] INFO "GET /members/api/member/" 204 8ms
[2024-11-10 10:45:16] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 304 25ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 36ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 21ms
[2024-11-10 10:45:16] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 22ms
[2024-11-10 10:45:23] INFO "GET /" 200 49ms
[2024-11-10 10:45:24] INFO "GET /members/api/member/" 204 1ms
[2024-11-10 10:45:24] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 200 4ms
[2024-11-10 10:45:24] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 7ms
[2024-11-10 10:45:24] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 13ms
[2024-11-10 10:45:24] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 10ms
[2024-11-10 10:45:38] INFO "GET /members/api/integrity-token/" 200 4ms
[2024-11-10 10:45:51] INFO "GET /" 200 55ms
[2024-11-10 10:45:52] INFO "GET /members/api/member/" 204 1ms
[2024-11-10 10:45:52] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 12ms
[2024-11-10 10:45:52] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 200 12ms
[2024-11-10 10:45:52] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 18ms
[2024-11-10 10:45:52] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 200 4ms
[2024-11-10 10:46:07] INFO "GET /members/api/integrity-token/" 200 1ms
[2024-11-10 10:46:07] ERROR "POST /members/api/send-magic-link/" 429 11ms

Too many different sign-in attempts, try again in 10 minutes

"Too many login attempts."
"Too many login attempts."

Error ID:
    fdba9bc0-9f50-11ef-a298-3d6d0339f5e7

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

TooManyRequestsError: Too many different sign-in attempts, try again in 10 minutes
    at failCallback (/var/lib/ghost/versions/5.95.0/core/server/web/shared/middleware/api/spam-prevention.js:233:33)
    at module.exports.<anonymous> (/var/lib/ghost/versions/5.95.0/node_modules/express-brute/index.js:146:44)
    at tryCatcher (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/util.js:16:23)
    at Promise.successAdapter [as _fulfillmentHandler0] (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/nodeify.js:23:30)
    at Promise._settlePromise (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/promise.js:601:21)
    at Promise._settlePromise0 (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/async.js:102:5)
    at Async.drainQueues [as _onImmediate] (/var/lib/ghost/versions/5.95.0/node_modules/bluebird/js/release/async.js:15:14)
    at process.processImmediate (node:internal/timers:476:21)

[2024-11-10 10:46:17] INFO Updating incoming recommendations on boot
[2024-11-10 10:47:08] INFO "POST /members/api/send-magic-link/" 200 90003ms
[2024-11-10 10:47:31] INFO "GET /" 200 80ms
[2024-11-10 10:47:38] ERROR Failed to send email. Reason: Connection timeout.

Failed to send email. Reason: Connection timeout.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

Error ID:
    3405afd0-9f51-11ef-a298-3d6d0339f5e7

Error Code:
    ETIMEDOUT

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

Error: Connection timeout
    at createMailError (/var/lib/ghost/versions/5.95.0/core/server/services/mail/GhostMailer.js:105:12)
    at SMTPConnection._formatError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)
    at SMTPConnection._onError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:793:20)
    at Timeout.<anonymous> (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:237:22)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

[2024-11-10 10:48:52] INFO [Recommendations] Updating recommendations metadata
[2024-11-10 10:52:45] INFO "GET /" 200 90ms
[2024-11-10 10:52:48] INFO "GET /" 200 50ms
[2024-11-10 10:52:51] INFO "GET /members/api/member/" 204 1ms
[2024-11-10 10:52:51] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 200 9ms
[2024-11-10 10:52:51] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 200 16ms
[2024-11-10 10:52:51] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 30ms
[2024-11-10 10:52:51] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 25ms
[2024-11-10 10:53:03] INFO "GET /assets/fonts/jetbrains-mono-v13-latin-700italic.woff2" 200 6ms
[2024-11-10 10:53:03] INFO "GET /assets/fonts/jetbrains-mono-v13-latin-700.woff2" 200 6ms
[2024-11-10 10:53:03] INFO "GET /assets/fonts/jetbrains-mono-v13-latin-800.woff2" 200 4ms
[2024-11-10 10:53:03] INFO "GET /assets/fonts/jetbrains-mono-v13-latin-italic.woff2" 200 4ms
[2024-11-10 10:53:04] INFO "GET /assets/fonts/jetbrains-mono-v13-latin-regular.woff2" 200 6ms
[2024-11-10 10:53:04] INFO "GET /assets/fonts/libre-baskerville-v14-latin-700.woff2" 200 7ms
[2024-11-10 10:53:04] INFO "GET /assets/fonts/libre-baskerville-v14-latin-regular.woff2" 200 6ms
[2024-11-10 10:53:04] INFO "GET /assets/fonts/libre-baskerville-v14-latin-italic.woff2" 200 3ms
[2024-11-10 10:57:57] INFO "GET /ghost/" 200 18ms
[2024-11-10 10:57:57] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 42ms
[2024-11-10 10:57:57] INFO "GET /ghost/api/admin/site/" 200 2ms
[2024-11-10 10:57:57] INFO "GET /ghost/api/admin/config/" 200 15ms
[2024-11-10 10:57:57] INFO "GET /ghost/api/admin/tiers/?filter=type%3Apaid%2Bactive%3Atrue&limit=all" 200 53ms
[2024-11-10 10:57:57] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations%2Crecommendations" 200 59ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/admin/themes/active/" 200 40ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/admin/notifications/" 200 38ms
[2024-11-10 10:57:58] INFO "GET /?v=1731236287059" 200 70ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/admin/members/?order=id&limit=1&page=1&include=newsletters%2Clabels" 200 92ms
[2024-11-10 10:57:58] INFO "GET /members/api/member/" 204 2ms
[2024-11-10 10:57:58] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 304 3ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 14ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 21ms
[2024-11-10 10:57:58] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 22ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/site/" 200 2ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/config/" 200 33ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations" 200 68ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 90ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/invites/" 200 138ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/tiers/" 200 119ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/users/?limit=100&include=roles" 200 169ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/recommendations/?include=count.clicks%2Ccount.subscribers&order=created_at+desc&limit=5" 200 165ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/stats/referrers/" 200 152ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/newsletters/?include=count.active_members%2Ccount.posts&limit=50" 200 152ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/incoming_recommendations/?limit=5&order=created_at+desc" 200 171ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/roles/?limit=all" 200 153ms
[2024-11-10 10:58:01] INFO "GET /ghost/api/admin/integrations/?include=api_keys%2Cwebhooks" 200 161ms
[2024-11-10 10:58:55] INFO "GET /ghost/api/admin/integrations/?include=api_keys" 200 38ms
[2024-11-10 11:02:55] INFO "GET /ghost/api/admin/integrations/?include=api_keys" 200 40ms
[2024-11-10 11:06:55] INFO "GET /ghost/api/admin/integrations/?include=api_keys" 200 43ms
[2024-11-10 11:28:22] INFO "GET /robots.txt" 200 8ms
[2024-11-10 11:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 11:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 12:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 12:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 13:09:21] INFO "GET /robots.txt" 200 5ms
[2024-11-10 13:09:31] INFO "GET /" 200 70ms
[2024-11-10 13:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 13:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 13:41:40] INFO "GET /" 200 72ms
[2024-11-10 14:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 14:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 14:40:41] INFO Worker for job "clean-tokens" online
[2024-11-10 14:40:41] INFO Worker for job clean-tokens sent a message: Removed 0 tokens created before 2024-11-09T14:40:41.094Z in 620ms
[2024-11-10 14:40:41] INFO Worker for job clean-tokens sent a message: done
[2024-11-10 14:59:27] INFO "GET /" 200 75ms
[2024-11-10 15:02:59] INFO "GET /" 200 85ms
[2024-11-10 15:06:44] INFO "GET /" 200 101ms
[2024-11-10 15:06:45] INFO "GET /members/api/member/" 204 1ms
[2024-11-10 15:06:45] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 24ms
[2024-11-10 15:06:46] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 200 19ms
[2024-11-10 15:06:46] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 200 31ms
[2024-11-10 15:06:46] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 200 4ms
[2024-11-10 15:06:48] INFO "GET /favicon.ico" 302 6ms
[2024-11-10 15:07:18] INFO "GET /assets/built/screen.css.map" 200 11ms
[2024-11-10 15:07:19] INFO "GET /members/api/integrity-token/" 200 2ms
[2024-11-10 15:08:50] INFO "POST /members/api/send-magic-link/" 200 90003ms
[2024-11-10 15:09:20] ERROR Failed to send email. Reason: Connection timeout.

Failed to send email. Reason: Connection timeout.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

Error ID:
    c3253400-9f75-11ef-a298-3d6d0339f5e7

Error Code:
    ETIMEDOUT

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

Error: Connection timeout
    at createMailError (/var/lib/ghost/versions/5.95.0/core/server/services/mail/GhostMailer.js:105:12)
    at SMTPConnection._formatError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)
    at SMTPConnection._onError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:793:20)
    at Timeout.<anonymous> (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:237:22)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

[2024-11-10 15:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 15:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 16:14:31] INFO "GET /members/api/member/" 204 5ms
[2024-11-10 16:14:31] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 19ms
[2024-11-10 16:14:31] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 15ms
[2024-11-10 16:14:32] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 12ms
[2024-11-10 16:20:54] INFO "GET /members/api/member/" 204 4ms
[2024-11-10 16:20:54] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 28ms
[2024-11-10 16:20:54] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 30ms
[2024-11-10 16:20:54] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 36ms
[2024-11-10 16:28:22] INFO "GET /" 301 6ms
[2024-11-10 16:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 16:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 17:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 17:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 17:40:20] INFO "GET /robots.txt" 200 7ms
[2024-11-10 18:16:26] INFO "GET /" 200 101ms
[2024-11-10 18:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 18:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 19:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 19:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 20:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 20:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 21:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 21:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 22:10:30] INFO "GET /author/amar/" 200 110ms
[2024-11-10 22:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 22:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-10 23:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-10 23:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-11 00:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-11 00:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-11 01:30:23] INFO Worker for job "mentions-email-report" online
[2024-11-11 01:30:23] INFO Worker for job mentions-email-report sent a message: done
[2024-11-11 01:34:28] INFO "GET /" 200 76ms
[2024-11-11 01:47:23] INFO Worker for job "clean-expired-comped" online
[2024-11-11 01:47:23] INFO Worker for job clean-expired-comped sent a message: Removed 0 expired subscriptions, updated 0 members in 603ms
[2024-11-11 01:47:23] INFO Worker for job clean-expired-comped sent a message: done
[2024-11-11 02:10:25] INFO "GET /ghost/" 200 13ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 54ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/site/" 200 2ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/config/" 200 8ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations%2Crecommendations" 200 36ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/tiers/?filter=type%3Apaid%2Bactive%3Atrue&limit=all" 200 37ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/notifications/" 200 29ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/themes/active/" 200 34ms
[2024-11-11 02:10:25] INFO "GET /ghost/api/admin/members/?order=id&limit=1&page=1&include=newsletters%2Clabels" 200 39ms
[2024-11-11 02:10:27] INFO "GET /?v=1731291026787" 200 35ms
[2024-11-11 02:10:27] INFO "GET /members/api/member/" 204 1ms
[2024-11-11 02:10:27] INFO "GET /members/api/comments/counts/?ids=67010e34786d9f0001a75dca,67010d31786d9f0001a75dbd,67010a42786d9f0001a75d9a" 304 7ms
[2024-11-11 02:10:27] INFO "GET /ghost/api/content/settings/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 24ms
[2024-11-11 02:10:27] INFO "GET /ghost/api/content/tiers/?key=ac07b84caa353eba3e2ccc868e&limit=all&include=monthly_price,yearly_price,benefits" 304 33ms
[2024-11-11 02:10:27] INFO "GET /ghost/api/content/newsletters/?key=ac07b84caa353eba3e2ccc868e&limit=all" 304 35ms
[2024-11-11 02:10:33] INFO "GET /members/api/integrity-token/" 200 1ms
[2024-11-11 02:12:03] INFO "POST /members/api/send-magic-link/" 200 90001ms
[2024-11-11 02:12:33] ERROR Failed to send email. Reason: Connection timeout.

Failed to send email. Reason: Connection timeout.

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

Error ID:
    69556f50-9fd2-11ef-a298-3d6d0339f5e7

Error Code:
    ETIMEDOUT

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

Error: Connection timeout
    at createMailError (/var/lib/ghost/versions/5.95.0/core/server/services/mail/GhostMailer.js:105:12)
    at SMTPConnection._formatError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:807:19)
    at SMTPConnection._onError (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:793:20)
    at Timeout.<anonymous> (/var/lib/ghost/versions/5.95.0/node_modules/nodemailer/lib/smtp-connection/index.js:237:22)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

root@localhost:~/ghost#

I ended up figuring that I made some kind of change in my docker networking configuration as I was setting things up, which resulted in a bridge network between the ghost container and the database container being configured and not being able to communicate to the host network. This prevented all outbound traffic.

I experimented with configuring a squid proxy but only dedicated a little bit of time, during which I couldn’t figure out the solution.

My answer was to spin up a new VM and just install ghost without docker.

interesting ok. i am sure there could be a way to do this using docker compose. havent others managed? otherwise really if there is not the Ghost docker compose method would be of no use.

That’s not a docker-specific problem. That’s repeated failures triggering brute-force protection. If you’re willing to hack the db, you can remove entries from the brute table, or just wait. :)

This error is where the issue is I think

Agreed! The brute force protection is just a symptom.