`ghost run` works, `ghost start` does not

Hi, I recently had to restore my server which of course meant I have to restart ghost. This backup was only from 2 days ago so nothing was lost thankfully. However, when running ghost start I get the below output:
+ sudo systemctl is-active ghost_www-jmurray-me
:heavy_check_mark: Ensuring user is not logged in as ghost user
:heavy_check_mark: Checking if logged in user is directory owner
:heavy_check_mark: Checking current folder permissions
+ sudo systemctl is-active ghost_www-jmurray-me
:heavy_check_mark: Validating config
:heavy_check_mark: Checking folder permissions
:heavy_check_mark: Checking file permissions
:heavy_check_mark: Checking content folder ownership
:heavy_check_mark: Checking memory availability
+ sudo systemctl start ghost_www-jmurray-me
☲ Starting Ghost
and it simply hangs there for several minutes until I have to stop it. If I run ghost run I get the below output, however despite the warnings my site does actually run.

  • sudo node current/index.js
    [2019-09-05 21:55:05] INFO Ghost is running in production…
    [2019-09-05 21:55:05] INFO Your site is now available on https://www.jmurray.dev/
    [2019-09-05 21:55:05] INFO Ctrl+C to shut down
    [2019-09-05 21:55:05] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
    [2019-09-05 21:55:05] WARN Tries: 0
    [2019-09-05 21:55:05] WARN Retrying…
    [2019-09-05 21:55:05] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
    [2019-09-05 21:55:05] WARN Tries: 1
    [2019-09-05 21:55:05] WARN Retrying…
    [2019-09-05 21:55:05] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
    [2019-09-05 21:55:05] WARN Tries: 2
    [2019-09-05 21:55:05] WARN Retrying…
    [2019-09-05 21:55:06] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
    [2019-09-05 21:55:06] INFO Ghost boot 4.877s

Finally, if I run ghost doctor I get the below output.
:heavy_check_mark: Checking system Node.js version
:heavy_check_mark: Checking logged in user
:heavy_check_mark: Ensuring user is not logged in as ghost user
:heavy_check_mark: Checking if logged in user is directory owner
:heavy_check_mark: Checking current folder permissions
:heavy_check_mark: Checking operating system compatibility
:heavy_check_mark: Checking for a MySQL installation
+ sudo systemctl is-active ghost_www-jmurray-me
+ sudo systemctl reset-failed ghost_www-jmurray-me
:heavy_check_mark: Validating config
:heavy_check_mark: Checking folder permissions
:heavy_check_mark: Checking file permissions
:heavy_check_mark: Checking content folder ownership
:heavy_check_mark: Checking memory availability

There are no errors logs in /content/logs/ so I’m at a complete loss as to what the problem could be. I’m assuming that perhaps the warnings above have something to do with it? But then my site appears to work just fine so maybe not.

Any help would be appreciated!

Howdy @jbm1991!
Looks like Ghost is trying to use port 8000, do you already have something else running on that port number? :slightly_smiling_face:

Hey! I do not have anything else running on this server at all, only ghost. Presumably though if something was running on 8000 then ghost run would fail?

Not exactly…

ghost start is designed to make sure your Ghost instance starts before the command exits. It does this by launching a lightweight listener on port 8000 (or the closest open port) and waiting for the Ghost Instance to say “Hey, I’ve started” before removing the listener. ghost run is the command used by the process manager to run Ghost.

So…

ghost start opens 8000
… and then tells systemctl to start your instance
… … which runs ghost run to run Ghost
… … … which eventually starts up and tells 8000 it’s up
which triggers ghost start to close 8000 and tell you Ghost has started

By running ghost run, 8000 is never opened, so you get the warning about not being able to connect to the bootstrap socket

Hopefully this makes sense :slight_smile:

2 Likes

Can you please share the contents of your config.production.json file, and also the nginx configs found in system/files?

1 Like

I have the same problem, here is the result of doing journalctl -u ghost_blog-snowfrog-dev -n 50:

-- Logs begin at Thu 2019-08-15 02:49:12 UTC, end at Wed 2020-10-21 19:20:59 UTC. --
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 node[5173]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 node[5173]:     at Module._compile (module.js:652:30)
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Service hold-off time over, scheduling restart.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Scheduled restart job, restart counter is at 3.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Stopped Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Started Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]: /usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:         throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.cOct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:         ^
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]: Error: yargs parser supports a minimum Node.js version of 10. Read our version support policy: https://github.com/yargs/yargs-parser#supportOct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990:15)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module._compile (module.js:652:30)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.Module._extensions..js (module.js:663:10)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module.load (module.js:565:32)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at tryModuleLoad (module.js:505:12)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Function.Module._load (module.js:497:3)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module.require (module.js:596:17)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at require (internal/module.js:11:18)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module._compile (module.js:652:30)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Service hold-off time over, scheduling restart.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Scheduled restart job, restart counter is at 4.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Stopped Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Started Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]: /usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:         throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.cOct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:         ^
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]: Error: yargs parser supports a minimum Node.js version of 10. Read our version support policy: https://github.com/yargs/yargs-parser#supportOct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990:15)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module._compile (module.js:652:30)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.Module._extensions..js (module.js:663:10)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module.load (module.js:565:32)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at tryModuleLoad (module.js:505:12)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Function.Module._load (module.js:497:3)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module.require (module.js:596:17)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at require (internal/module.js:11:18)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module._compile (module.js:652:30)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
lines 1-44...skipping...
-- Logs begin at Thu 2019-08-15 02:49:12 UTC, end at Wed 2020-10-21 19:20:59 UTC. --
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 node[5173]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 node[5173]:     at Module._compile (module.js:652:30)
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 19:14:07 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Service hold-off time over, scheduling restart.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Scheduled restart job, restart counter is at 3.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Stopped Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Started Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]: /usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:         throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versiOct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:         ^
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]: Error: yargs parser supports a minimum Node.js version of 10. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990:15)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module._compile (module.js:652:30)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.Module._extensions..js (module.js:663:10)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module.load (module.js:565:32)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at tryModuleLoad (module.js:505:12)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Function.Module._load (module.js:497:3)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module.require (module.js:596:17)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at require (internal/module.js:11:18)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 node[5199]:     at Module._compile (module.js:652:30)
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 19:14:08 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Service hold-off time over, scheduling restart.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Scheduled restart job, restart counter is at 4.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Stopped Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Started Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]: /usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:         throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versiOct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:         ^
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]: Error: yargs parser supports a minimum Node.js version of 10. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:990:15)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module._compile (module.js:652:30)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.Module._extensions..js (module.js:663:10)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module.load (module.js:565:32)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at tryModuleLoad (module.js:505:12)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Function.Module._load (module.js:497:3)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module.require (module.js:596:17)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at require (internal/module.js:11:18)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Object.<anonymous> (/usr/local/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:2702:16)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 node[5228]:     at Module._compile (module.js:652:30)
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 19:14:09 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Service hold-off time over, scheduling restart.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Scheduled restart job, restart counter is at 5.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Stopped Ghost systemd service for blog: blog-snowfrog-dev.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Start request repeated too quickly.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: ghost_blog-snowfrog-dev.service: Failed with result 'exit-code'.
Oct 21 19:14:10 ghost-s-1vcpu-1gb-tor1-01 systemd[1]: Failed to start Ghost systemd service for blog: blog-snowfrog-dev.

Some of the errors seem to indicate that my version of node might be lower than 10. node -v confirms that I have v12.13.0.

ghost doctor gives:

✔ 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 system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-snowfrog-dev
+ sudo systemctl reset-failed ghost_blog-snowfrog-dev
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space

I have also tried running ghost buster and that didn’t seem to help.

I’m at a loss. Any help will be appreciated.

Can you try running which nodejs and which node and see if they produce different paths?

1 Like

They do.

# which nodejs
/usr/bin/nodejs
# which node
/usr/local/bin/node

You have multiple node versions installed. Take a look at this SE thread:

3 Likes

Thank you, this solved it for me.