Ghost service reliably crashes when sending transaction email test

  • What version of Ghost are you using? 3.14.2
  • What configuration?
{
  "URL": [redacted],
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost",
      "password": [redacted],
      "database": "ghost_production"
    }
  },
  "mail": {
    "from": [redacted],
    "transport": "Direct",
    "options": {
      "service": "Mailgun",
      "host": "smtp.mailgun.org",
      "port": 587,
      "secureConnection": false,
      "auth": {
        "user": "postmaster@mg.samism.io",
        "pass": [redacted],
      }
    }
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}

  • What browser? Chrome 88
  • What errors or information do you see in the console?
    When I “send test email”, this is what I get in /var/log/syslog:
Feb  7 18:35:42 ghost kernel: [  658.249379] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=106.75.254.114 DST=68.183.63.208 LEN=73 TOS=0x00 PREC=0x00 TTL=42 ID=39718 DF PROTO=TCP SPT=59798 DPT=22 WINDOW=221 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:42 ghost systemd[1]: ghost_[redacted].service: Service hold-off time over, scheduling restart.
Feb  7 18:35:42 ghost systemd[1]: ghost_[redacted].service: Scheduled restart job, restart counter is at 2.
Feb  7 18:35:42 ghost systemd[1]: Stopped Ghost systemd service for blog: [redacted].
Feb  7 18:35:42 ghost systemd[1]: Started Ghost systemd service for blog: [redacted].
Feb  7 18:35:43 ghost kernel: [  659.079497] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=106.75.254.114 DST=68.183.63.208 LEN=492 TOS=0x00 PREC=0x00 TTL=42 ID=39720 DF PROTO=TCP SPT=59798 DPT=22 WINDOW=238 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:43 ghost kernel: [  659.704072] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=106.75.254.114 DST=68.183.63.208 LEN=100 TOS=0x00 PREC=0x00 TTL=42 ID=39721 DF PROTO=TCP SPT=59798 DPT=22 WINDOW=238 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:44 ghost node[2411]: - Inspecting operating system
Feb  7 18:35:51 ghost kernel: [  667.164575] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=61.177.173.23 DST=68.183.63.208 LEN=67 TOS=0x00 PREC=0x00 TTL=45 ID=56564 DF PROTO=TCP SPT=54384 DPT=22 WINDOW=229 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:51 ghost kernel: [  667.391811] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=221.181.185.220 DST=68.183.63.208 LEN=67 TOS=0x04 PREC=0x00 TTL=41 ID=1754 DF PROTO=TCP SPT=38532 DPT=22 WINDOW=229 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:52 ghost kernel: [  667.957546] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=61.177.173.23 DST=68.183.63.208 LEN=908 TOS=0x00 PREC=0x00 TTL=45 ID=56566 DF PROTO=TCP SPT=54384 DPT=22 WINDOW=229 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:52 ghost kernel: [  668.268985] [UFW BLOCK] IN=eth0 OUT= MAC=9a:7a:c5:c1:93:3f:c0:42:d0:39:2c:30:08:00 SRC=221.181.185.220 DST=68.183.63.208 LEN=908 TOS=0x04 PREC=0x00 TTL=41 ID=1756 DF PROTO=TCP SPT=38532 DPT=22 WINDOW=229 RES=0x00 ACK PSH URGP=0 
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Ghost is running in production...
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Your site is now available on [redacted]
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Ctrl+C to shut down
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Ghost boot 9.925s
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Adding offloaded job to the queue
Feb  7 18:35:54 ghost node[2411]: [2021-02-07 18:35:54] #033[36mINFO#033[39m Scheduling job email-analytics-fetch-latest at 21 2/5 * * * *. Next run on: Sun Feb 07 2021 18:37:21 GMT+0000 (Coordinated Universal Time)

I noticed that whenever I do ghost doctor it skips checking my config. So I tried to see if I can prod into any of the npm scripts for insight. I tried running npm run ci in my current folder to see what grunt can tell me about the tests. Here’s what I got, which was interesting, given that my config is in the root ghost folder,the JSON is not malformed, and the data structure database.connection.[...] tracks with my config file:

ghost-mgr@ghost:/var/www/ghost$ ghost stop
+ sudo systemctl is-active ghost_[redacted]
+ sudo systemctl stop ghost_[redacted]
âś” Stopping Ghost: [redacted]
ghost-mgr@ghost:/var/www/ghost$ cd current
ghost-mgr@ghost:/var/www/ghost/current$ npm run ci

> ghost@3.41.2 ci /var/www/ghost/versions/3.41.2
> grunt validate --verbose

Initializing
Command-line options: --verbose, --gruntfile=/var/www/ghost/versions/3.41.2/Gruntfile.js

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: Cannot read property 'connection' of undefined
>>     at exports.Provider.sanitizeDatabaseProperties (/var/www/ghost/versions/3.41.2/core/shared/config/utils.js:103:25)
>>     at Object.loadNconf (/var/www/ghost/versions/3.41.2/core/shared/config/index.js:52:11)
>>     at Object.<anonymous> (/var/www/ghost/versions/3.41.2/core/shared/config/index.js:83:27)
>>     at Module._compile (internal/modules/cjs/loader.js:999:30)
>>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
>>     at Module.load (/var/www/ghost/versions/3.41.2/node_modules/coffeescript/lib/coffeescript/register.js:53:36)
>>     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
>>     at Module.require (internal/modules/cjs/loader.js:887:19)
>>     at require (internal/modules/cjs/helpers.js:74:18)
>>     at Object.<anonymous> (/var/www/ghost/versions/3.41.2/core/server/overrides.js:1:16)
>>     at Module._compile (internal/modules/cjs/loader.js:999:30)
>>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
>>     at Module.load (/var/www/ghost/versions/3.41.2/node_modules/coffeescript/lib/coffeescript/register.js:53:36)
>>     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
>>     at Module.require (internal/modules/cjs/loader.js:887:19)
>>     at require (internal/modules/cjs/helpers.js:74:18)
>>     at Object.<anonymous> (/var/www/ghost/versions/3.41.2/Gruntfile.js:9:1)
>>     at Module._compile (internal/modules/cjs/loader.js:999:30)
>>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
>>     at Module.load (/var/www/ghost/versions/3.41.2/node_modules/coffeescript/lib/coffeescript/register.js:53:36)
>>     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
>>     at Module.require (internal/modules/cjs/loader.js:887:19)
>>     at require (internal/modules/cjs/helpers.js:74:18)
>>     at loadTask (/var/www/ghost/versions/3.41.2/node_modules/grunt/lib/grunt/task.js:313:10)
>>     at Task.task.init (/var/www/ghost/versions/3.41.2/node_modules/grunt/lib/grunt/task.js:450:5)
>>     at Object.grunt.tasks (/var/www/ghost/versions/3.41.2/node_modules/grunt/lib/grunt.js:129:8)
>>     at Liftoff.<anonymous> (/var/www/ghost/versions/3.41.2/node_modules/grunt/node_modules/grunt-cli/bin/grunt:66:13)
>>     at Liftoff.execute (/var/www/ghost/versions/3.41.2/node_modules/grunt/node_modules/liftoff/index.js:203:12)
>>     at module.exports (/var/www/ghost/versions/3.41.2/node_modules/flagged-respawn/index.js:51:3)
>>     at Liftoff.<anonymous> (/var/www/ghost/versions/3.41.2/node_modules/grunt/node_modules/liftoff/index.js:195:5)
>>     at Liftoff.<anonymous> (/var/www/ghost/versions/3.41.2/node_modules/grunt/node_modules/liftoff/index.js:170:7)
>>     at processTicksAndRejections (internal/process/task_queues.js:79:11)

Running tasks: validate
Warning: Task "validate" not found. Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! ghost@3.41.2 ci: `grunt validate --verbose`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the ghost@3.41.2 ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ghost-mgr/.npm/_logs/2021-02-07T18_44_27_812Z-debug.log
ghost-mgr@ghost:/var/www/ghost/current$
  • What steps could someone else take to reproduce the issue you’re having?
  1. Install via integration on DigitalOcean: 1 GB Memory / 25 GB Disk / NYC3 - Ghost on Ubuntu 18.04
  2. Use the production config provided
  3. Ensure that the nginx conf for both SSL / default sites-enabled points to port 2368
  4. Restart ghost
  5. Enable bulk email send to members on publish
  6. Make a dummy post and either trigger transactional mail test via Post settings → Email newsletter → Send test email or publish the post (to send newsletter to members)
  7. Refresh the page immediately to observe the nginx 502, wait 3 seconds and refresh again to observe ghost restarting successfully.

Given

Service hold-off time over, scheduling restart.

It seems like it’s not crashing, but immediately stopping and starting its instance. I tried searching for this in the main and CLI repos but couldn’t find any code with that message. After some googling, this seems like output from systemd / systemctl: the ghost service is terminating after it runs (or backgrounding), so systemd thinks your process is dying, and restarts it

This leads me to believe email is causing the service to either terminate or background, causing a restart. Any thoughts?

Might your issue be this bug? If so, it appears any info you could supply would be helpful.

@samism please can you share your Ghost logs? If Ghost is terminating and causing systemd to restart it then there should be something there.

Sure. I deleted my logs and then executed a “send test email” from the post page. This is the production log:

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Ghost is running in production...","time":"2021-02-09T15:37:38.078Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Your site is now available on https://samism.io/","time":"2021-02-09T15:37:38.085Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Ctrl+C to shut down","time":"2021-02-09T15:37:38.086Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Adding offloaded job to the queue","time":"2021-02-09T15:37:38.111Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Scheduling job email-analytics-fetch-latest at 1 4/5 * * * *. Next run on: Tue Feb 09 2021 15:39:01 GMT+0000 (Coordinated Universal Time)","time":"2021-02-09T15:37:38.152Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:37:38.212Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Tries: 0","time":"2021-02-09T15:37:38.213Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Retrying...","time":"2021-02-09T15:37:38.214Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:37:38.367Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Tries: 1","time":"2021-02-09T15:37:38.368Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Retrying...","time":"2021-02-09T15:37:38.369Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:37:38.521Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Tries: 2","time":"2021-02-09T15:37:38.523Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Retrying...","time":"2021-02-09T15:37:38.528Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:37:38.680Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"msg":"Ghost boot 7.772s","time":"2021-02-09T15:37:38.681Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"c531e3cb-c3fa-41b1-8a0d-ee5a468de3c9","userId":null},"url":"/","method":"GET","originalUrl":"/ghost/","params":{"0":"/"},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","cache-control":"max-age=0","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"none","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","x-frame-options":"sameorigin","accept-ranges":"bytes","last-modified":"Sat, 26 Oct 1985 08:15:00 GMT","etag":"W/\"db8-7438674ba0\"","content-type":"text/html; charset=UTF-8","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"59ms"},"msg":"","time":"2021-02-09T15:37:40.726Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"28e6f6cd-52b6-42d8-8c47-b6dfee43c354","userId":null},"url":"/img/favicon.ico","method":"GET","originalUrl":"/ghost/assets/img/favicon.ico","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","pragma":"no-cache","cache-control":"no-cache","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","accept":"image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","sec-fetch-dest":"image","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","accept-ranges":"bytes","cache-control":"public, max-age=31536000","last-modified":"Sat, 26 Oct 1985 08:15:00 GMT","etag":"W/\"3ec-7438674ba0\"","content-type":"image/x-icon","content-length":1004,"vary":"Accept-Encoding"},"statusCode":200,"responseTime":"26ms"},"msg":"","time":"2021-02-09T15:37:41.048Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"72b07ad8-af3f-4ab4-ae6f-da0128645c9f","userId":"1"},"url":"/users/me/?include=roles","method":"GET","originalUrl":"/ghost/api/v3/admin/users/me/?include=roles","params":{"id":"me"},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"include":"roles"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"727","etag":"W/\"2d7-XiulaxsrV/OWnjt4oN75l9rkZy4\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"88ms"},"msg":"","time":"2021-02-09T15:37:41.092Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"940907ab-62aa-4989-bb65-6711b6ab50d7","userId":null},"url":"/site/","method":"GET","originalUrl":"/ghost/api/v3/admin/site/","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"140","etag":"W/\"8c-kY+Y+2+JS9JSDbGpYNk52xyceS4\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"7ms"},"msg":"","time":"2021-02-09T15:37:41.159Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"dddc9fb3-7ad5-4200-a5d3-ffee291f19aa","userId":"1"},"url":"/config/","method":"GET","originalUrl":"/ghost/api/v3/admin/config/","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"236","etag":"W/\"ec-htZhKQ8ec1FJBBcG0sjmUloFJ3c\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"25ms"},"msg":"","time":"2021-02-09T15:37:41.232Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"a73f9120-65d8-4b8a-99b5-b1ca4cc2b931","userId":"1"},"url":"/notifications/","method":"GET","originalUrl":"/ghost/api/v3/admin/notifications/","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"378","etag":"W/\"17a-OooXZLMtiisIaWU9FhqaTDvaQEg\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"74ms"},"msg":"","time":"2021-02-09T15:37:41.295Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"e650fc0b-24e3-4af8-b9a1-c5f7e1178531","userId":"1"},"url":"/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter","method":"GET","originalUrl":"/ghost/api/v3/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"group":"site,theme,private,members,portal,newsletter,email,amp,labs,slack,unsplash,views,firstpromoter"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","etag":"W/\"36cb-kKbnngeJ32rdpAm9JSldX57UkdU\"","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"83ms"},"msg":"","time":"2021-02-09T15:37:41.298Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"10778865-0279-48dd-a968-48b0e25d9375","userId":"1"},"url":"/posts/601f49eb287ae251009bdbff/","method":"GET","originalUrl":"/ghost/api/v3/admin/posts/601f49eb287ae251009bdbff/","params":{"id":"601f49eb287ae251009bdbff"},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","etag":"W/\"4759-UvOdmTMvbLgY4jWlXkeqUvhEvpg\"","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"166ms"},"msg":"","time":"2021-02-09T15:37:41.543Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"7c4dbf13-bfe5-4870-b5a5-77dca9acc1bb","userId":"1"},"url":"/members/?limit=1&filter=subscribed%3Atrue&include=labels%2CemailRecipients","method":"GET","originalUrl":"/ghost/api/v3/admin/members/?limit=1&filter=subscribed%3Atrue&include=labels%2CemailRecipients","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"limit":"1","filter":"subscribed:true","include":"labels,emailRecipients"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"962","etag":"W/\"3c2-GlxWIdU/uua8LK5WKzLSUmGoifQ\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"48ms"},"msg":"","time":"2021-02-09T15:37:41.661Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"1f1bcd4d-402d-482f-98a5-1b2950dc5790","userId":"1"},"url":"/themes/","method":"GET","originalUrl":"/ghost/api/v3/admin/themes/","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","etag":"W/\"c9b-DjEV9464VG4TZPRSf71A9sFvIK0\"","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"124ms"},"msg":"","time":"2021-02-09T15:37:41.844Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"02af0944-8e6a-41cf-b831-6ba62ed94d03","userId":"1"},"url":"/tags/?limit=all","method":"GET","originalUrl":"/ghost/api/v3/admin/tags/?limit=all","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"limit":"all"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","etag":"W/\"c94-t68jNym6aPwIwg0FGkPjUydWjqc\"","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"144ms"},"msg":"","time":"2021-02-09T15:37:41.851Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"434f4180-e791-4c03-bf77-d79d7d1f4fea","userId":"1"},"url":"/users/?limit=all&include=roles","method":"GET","originalUrl":"/ghost/api/v3/admin/users/?limit=all&include=roles","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"limit":"all","include":"roles"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","etag":"W/\"58c-MditvalyeNbd0MYbnn8edtWOuSA\"","vary":"Accept-Encoding","content-encoding":"gzip"},"statusCode":200,"responseTime":"146ms"},"msg":"","time":"2021-02-09T15:37:41.855Z","v":0}

{"name":"Log","hostname":"ghost","pid":25354,"level":30,"req":{"meta":{"requestId":"3914e5f8-b5d0-46e7-8e3b-b722b3c48bb6","userId":"1"},"url":"/snippets/?limit=all","method":"GET","originalUrl":"/ghost/api/v3/admin/snippets/?limit=all","params":{},"headers":{"x-forwarded-for":"45.56.140.184","x-forwarded-proto":"https","x-real-ip":"45.56.140.184","host":"samism.io","connection":"close","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","app-pragma":"no-cache","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36","content-type":"application/json; charset=UTF-8","accept":"application/json, text/javascript, */*; q=0.01","x-requested-with":"XMLHttpRequest","x-ghost-version":"3.41","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://samism.io/ghost/","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,fr;q=0.8","sec-gpc":"1","cookie":"**REDACTED**"},"query":{"limit":"all"}},"res":{"_headers":{"x-powered-by":"Express","cache-control":"no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0","content-type":"application/json; charset=utf-8","content-length":"106","etag":"W/\"6a-P/Xz698jPBAiP0yXVF8SOryKOtc\"","vary":"Accept-Encoding"},"statusCode":200,"responseTime":"120ms"},"msg":"","time":"2021-02-09T15:37:41.862Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Ghost is running in production...","time":"2021-02-09T15:38:22.452Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Your site is now available on https://samism.io/","time":"2021-02-09T15:38:22.455Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Ctrl+C to shut down","time":"2021-02-09T15:38:22.457Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Adding offloaded job to the queue","time":"2021-02-09T15:38:22.472Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Scheduling job email-analytics-fetch-latest at 35 0/5 * * * *. Next run on: Tue Feb 09 2021 15:40:35 GMT+0000 (Coordinated Universal Time)","time":"2021-02-09T15:38:22.501Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:38:22.524Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Tries: 0","time":"2021-02-09T15:38:22.525Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Retrying...","time":"2021-02-09T15:38:22.526Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:38:22.679Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Tries: 1","time":"2021-02-09T15:38:22.680Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Retrying...","time":"2021-02-09T15:38:22.680Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:38:22.833Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Tries: 2","time":"2021-02-09T15:38:22.834Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Retrying...","time":"2021-02-09T15:38:22.834Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":40,"msg":"Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.","time":"2021-02-09T15:38:22.987Z","v":0}

{"name":"Log","hostname":"ghost","pid":25591,"level":30,"msg":"Ghost boot 7.062s","time":"2021-02-09T15:38:22.989Z","v":0}

The error production log was empty.

@samism it sounds like you may have also encountered this issue. Can you check your mailgun settings and make sure your domain is entered correctly?

Check out smpt endpoint. Here’s my config which works fine:

  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 465,
      "secureConnection": true,
      "auth": {
        "user": "noreply@rozhkov.me",
        "pass": "kekeke"
      }
    }
  },

Note that I’m using secure connection, and secure connection port mentioned in Ghost docs incorrectly, it’s 465 and not 587.

Also:

config for transaction emails is not the same as config for batch emails. They could be different. Transaction emails are the ones about successful signup and new admin invitation. Batch emails are about sending posts to members. When you sending even single test email, it uses batch email config, not the transactional one. Do not confuse them.

Thank you @rozhok and @Kevin! Everything’s working now.

I did not realize that the domain it was looking for in Labs → Members → Newsletter Settings was the domain created in Mailgun, NOT the Mailgun API base URL.

config for transaction emails is not the same as config for batch emails. They could be different. Transaction emails are the ones about successful signup and new admin invitation. Batch emails are about sending posts to members. When you sending even single test email, it uses batch email config, not the transactional one. Do not confuse them.

I did not know that the bulk email config was used for everything other than successful signups and new admin invitations. @Kevin can you confirm that this is the case? Also @Kevin can you confirm that the port for secure connection should be 465 and not 587, as stated in the docs? If @rozhok hadn’t mentioned that, I would have never known.

I did not realize that the domain it was looking for in Labs → Members → Newsletter Settings was the domain created in Mailgun, NOT the Mailgun API base URL.

Haha, it’s funny how we’ve both trapped into same caveat. While the label explicitly says “Mailgun Domain” for some reason I thought it should be Mailgun enpoint.

I did not know that the bulk email config was used for everything other than successful signups

To be clear.
Transactional emails config → in json file → used for members signups/confirmations and admins invites
Bulk emails config → in members page → used for sending posts to members. “Send test email” from the post page also uses this API.

Also it’s worth mentioning that you’d better to configure transactional emails in the same way as bulk, because if you’ll use default nodemailer config, signup emails will fall into Spam folders especially if you configure SPF/DKIM records and use same domain for emails sending. This is also not mentioned in docs.

1 Like

Thanks for this info. I am not 100% sure what you mean by “configure transactional emails in the same way as bulk.” Do you just mean using Mailgun for both and not using Nodemailer? That is what I am set up with now. Or do you mean “don’t use SMTP for Mailgun in config.production.json because bulk emails use Mailgun API”?

  1. configure transactional emails in config.json using Mailgun SMTP credentials
  2. configure bulk emails in UI using Mailgun API

and you’ll be fine.

2 Likes