Encountering Exit Code 3 When using Ghost-cli

Whenever ghost-cli option I use, always return the following message. This happened after I restart my server (centos 7).

A ProcessError occurred.

Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  systemctl is-active xxx-com

unknown

Exit code: 3


Debug Information:
    OS: linux, v3.10.0-957.10.1.el7.x86_64
    Node Version: v10.16.0
    Ghost-CLI Version: 1.11.0
    Environment: production
    Command: 'ghost ls'

Additional log info available in: /home/aqutor/.ghost/logs/ghost-cli-debug-2019-07-22T18_36_49_851Z.log

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

@aqutor Is there any further information in the referenced log file?

Additional log info available in: /home/aqutor/.ghost/logs/ghost-cli-debug-2019-07-22T18_36_49_851Z.log

nope. It seems this happened due to ghost-cli can not get access to this ghost instance. Because if I run ghost command in another ghost instance, everything went just fine as long as I don’t get the other instance’s information (like run ghost ls would cause trouble).

Debug Information:
    OS: linux, v3.10.0-957.10.1.el7.x86_64
    Node Version: v10.16.0
    Ghost-CLI Version: 1.11.0
    Environment: production
    Command: 'ghost ls'
Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  systemctl is-active ghost_xxx-com

unknown

Exit code: 3

--------------- stdout ---------------
unknown

This case has been resolved. I use systemctl start ghost_xxx-com to start the instance.
ghost_xxx-com refers to your ghost instance’s name.

Can you try running sudo systemctl is-active ghost_xxx-com and seeing if the command fails? I’m curious to see if there’s an issue with your systemd service or if something’s wonky in the CLI :slight_smile:

It returns active now.