Update to 3.01 and can't `ghost start`

I tried to update to 3.0.1 but am having issues getting Ghost to start again, using ghost start, or ghost restart.

ghost start
+ sudo systemctl is-active ghost_brettdewoody-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_brettdewoody-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
+ sudo systemctl start ghost_brettdewoody-com
+ sudo systemctl stop ghost_brettdewoody-com
✖ Starting Ghost
A GhostError occurred.

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

The logs a series of these:

ghost_brettdewoody-com.service: Service hold-off time over, scheduling restart.
Stopped Ghost systemd service for blog: brettdewoody-com.
Started Ghost systemd service for blog: brettdewoody-com.
ghost_brettdewoody-com.service: Main process exited, code=exited, status=203/EXEC
ghost_brettdewoody-com.service: Unit entered failed state.
ghost_brettdewoody-com.service: Failed with result 'exit-code'.

I have also updated Node to 10.13.9 recently. Here’s the path to Node and Ghost:

  1. /home/brettdewoody/.nvm/versions/node/v10.13.0/bin/node
  2. /home/brettdewoody/.nvm/versions/node/v10.13.0/bin/ghost

Debug Information:
OS: Ubuntu, v16.04
Node Version: v10.13.0
Ghost-CLI Version: 1.12.0
Environment: production
Command: ‘ghost start’

Contents of ghost_brettdewoody-com.service:

[Unit]
Description=Ghost systemd service for blog: brettdewoody-com
Documentation=https://docs.ghost.org

[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=107
Environment="NODE_ENV=production"
ExecStart=/home/brettdewoody/.nvm/versions/node/v10.13.0/bin/node /home/brettdewoody/.nvm/versions/node/v10.13.0/bin/ghost
Restart=always

[Install]
WantedBy=multi-user.target

I’ve read through some of the similar issues and tried their solutions, but am still getting the same error. Any other things I should try?

You might try ghost run to see if there are any error codes that are being spit out

ghost run eventually starts up, with this:

[2019-10-30 08:12:34] INFO Ghost is running in production...
[2019-10-30 08:12:34] INFO Your site is now available on https://brettdewoody.com/
[2019-10-30 08:12:34] INFO Ctrl+C to shut down
[2019-10-30 08:12:34] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-30 08:12:34] WARN Tries: 0
[2019-10-30 08:12:34] WARN Retrying...
[2019-10-30 08:12:34] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-30 08:12:34] WARN Tries: 1
[2019-10-30 08:12:34] WARN Retrying...
[2019-10-30 08:12:34] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-30 08:12:34] WARN Tries: 2
[2019-10-30 08:12:34] WARN Retrying...
[2019-10-30 08:12:35] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-30 08:12:35] INFO Ghost boot 6.082s
[2019-10-30 08:13:11] WARN {{#get}} helper took 476ms to complete

{{#get}} helper took 476ms to complete

Error ID:
    1d6bfbc0-faed-11e9-877d-9d8d002d155a

Error Code: 
    SLOW_GET_HELPER

Details:
    api:          v3.[object Object].browse
    apiOptions: 
      order:   count.posts desc
      include: count.posts
      limit:   5
    returnedRows: 4


[2019-10-30 08:13:11] WARN {{#get}} helper took 485ms to complete

{{#get}} helper took 485ms to complete

Error ID:
    1d6c9800-faed-11e9-877d-9d8d002d155a

Error Code: 
    SLOW_GET_HELPER

Details:
    api:          v3.[object Object].browse
    apiOptions: 
      limit: 3
    returnedRows: 3


[2019-10-30 08:13:11] INFO "GET /favicon.png" 200 123ms
...
1 Like

This line is most likely the reason for the problem:
WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED

Something is holding up the :8000 port. Can you check what process is doing that by runninglsof -i:8000?

Checking the process on port 8000 results in nothing.

FWIW, I ran into the same and I think it’s a case of a particularly misleading error message from systemctl, plus an opportunity to surface that output better from Ghost perhaps. If you run the command directly (where <name of your site> is the name you’d see in the output of ghost start):

$ sudo systemctl start <name of your site>

In my case, this gave the actual error:

Warning: The unit file, source configuration file or drop-ins of ghost_krycho-com-1.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.

(Note that because of the configuration, you actually need to run sudo systemctl daemon-reload; otherwise you’re apt to see errors like “The name org.freedesktop.PolicyKit1 was not provided by any .service files”.)

After running sudo systemctl daemon-reload, try running ghost start again. In my case at least, this solved the problem.

As far as I can tell, this happens if Ghost updates the service definition (<the Ghost install directory>/system/files/<your site name>.system) but doesn’t (successfully) reload the systemctl daemon. You’ll see the same if you for some reason need to edit that file to specify a different node or Ghost binary path and fail to restart it manually yourself.

3 Likes

Thanks @chriskrycho, your post eventually led me to a solution. Posting here for others.

  1. Remove or rename the `/system/files/[sitename].service file
  2. Run ghost setup systemd
  3. Run ghost start
1 Like

Thanks. Your suggestion worked for me

My hero :smile: Thanks for sharing! What a hair puller. Happened to me when I started copying dirs around.

I had a similar error. ghost doctor was no help so I decided to try ghost setup. Re-entered the mysql information and then my site started up again.

I got this error after trying to add a domain to my Ghost instance. The add failed because it already existed in /etc/nginx/sites-available.

I hope this helps some.