Ghost start results in could not communicate with ghost error

I recently set up a new server and can’t seem to get Ghost running. Here are the details about my setup.

System Details

  • Ubuntu 18.04
  • Node v10.15.3
  • Yarn v1.19.1
  • NPM v6.4.1
  • Ghost CLI Version 1.13.1
  • Ghost Version: 3.0.3

When running ghost doctor, everything checks out and seems fine. When I run ghost start, it hangs for a couple of minutes and then outputs a message about not being able to communicate with Ghost. (Could not communicate with Ghost) I’ve included the output of the log below as well.

However, when I run ghost run the blog starts and I can access it in my web browser. I’m unable to start the service either. I’ve also tried running systemctl daemon-reload and relinking the system service myself.

Any help would be greatly appreciated.

ghost doctor output

✔ Checking system Node.js version
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking operating system compatibility
+ sudo systemctl is-active ghost_jacobhaug-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies

ghost start output

+ sudo systemctl is-active ghost_jacobhaug-com
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_jacobhaug-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
+ sudo systemctl start ghost_jacobhaug-com
+ sudo systemctl stop ghost_jacobhaug-com
✖ Starting Ghost: jacobhaug-com
A GhostError occurred.

Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_jacobhaug-com -n 50

Debug Information:
    OS: Ubuntu, v18.04.3 LTS
    Node Version: v10.15.3
    Ghost Version: 3.0.3
    Ghost-CLI Version: 1.13.1
    Environment: production
    Command: 'ghost start'

Additional log info available in: /server/.ghost/logs/ghost-cli-debug-2019-11-11T18_09_05_151Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.

Log Output

Debug Information:
    OS: Ubuntu, v18.04.3 LTS
    Node Version: v10.15.3
    Ghost Version: 3.0.3
    Ghost-CLI Version: 1.13.1
    Environment: production
    Command: 'ghost start'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_jacobhaug-com -n 50
Stack: Error: Could not communicate with Ghost
    at Server.server.close (/server/.config/yarn/global/node_modules/ghost-cli/lib/utils/port-polling.js:56:20)
    at Object.onceWrapper (events.js:277:13)
    at Server.emit (events.js:189:13)
    at emitCloseNT (net.js:1609:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)

ghost run output

The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
[2019-11-11 18:03:19] INFO Ghost is running in production...
[2019-11-11 18:03:19] INFO Your site is now available on https://blog.jacobhaug.com/
[2019-11-11 18:03:19] INFO Ctrl+C to shut down
[2019-11-11 18:03:19] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-11-11 18:03:19] WARN Tries: 0
[2019-11-11 18:03:19] WARN Retrying...
[2019-11-11 18:03:19] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-11-11 18:03:19] WARN Tries: 1
[2019-11-11 18:03:19] WARN Retrying...
[2019-11-11 18:03:20] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-11-11 18:03:20] WARN Tries: 2
[2019-11-11 18:03:20] WARN Retrying...
[2019-11-11 18:03:20] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-11-11 18:03:20] INFO Ghost boot 2.836s

contents of config.production.json

{
  "url": "https://blog.jacobhaug.com/",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "removed",
      "user": "removed",
      "password": "removed",
      "database": "removed"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/server/applications/jacobhaug.com/blog/content"
  },
  "bootstrap-socket": {
    "port": 8000,
    "host": "localhost"
  }
}

contents of .ghost-cli

{
  "active-version": "3.0.3",
  "cli-version": "1.13.1",
  "name": "jacobhaug-com"
}

Does anyone have any ideas what could be happening here?

Did you run the suggested command journalctl -u ghost_jacobhaug-com -n 50?

Ghost appears to be starting OK based on your ghost run output:

[2019-11-11 18:03:20] INFO Ghost boot 2.836s

I pasted the output from the log above as that command didn’t output any information.

What is weird, is ghost does start fine when running doing ghost run, but when doing ghost start it doesn’t run at all, it just hangs.

@jacob Have you found a solution to this issue? I just upgraded to 3.15.3 and I’m getting the same thing.

Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v10.16.3
Ghost Version: 3.15.3
Ghost-CLI Version: 1.13.1
Environment: production
Command: ‘ghost restart’
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_notunhealthy-com -n 50
Stack: Error: Could not communicate with Ghost
at Server.server.close (/usr/local/lib/node_modules/ghost-cli/lib/utils/port-polling.js:56:20)
at Object.onceWrapper (events.js:286:20)
at Server.emit (events.js:198:13)
at emitCloseNT (net.js:1618:8)
at process._tickCallback (internal/process/next_tick.js:63:19)

1 Like

Spoke too soon…

I followed the instructions for updating node here and then when I tried starting ghost it worked. FYI for anyone else having the issue.

2 Likes