Unable to start Ghost

Hi All,

I’ve installed Ghost as per the official Ubuntu guides, but am unable to start it. I see the below in the logs

Debug Information:
    OS: Ubuntu, v20.04.3 LTS
    Node Version: v14.18.1
    Ghost Version: 4.19.1
    Ghost-CLI Version: 1.17.4
    Environment: production
    Command: 'ghost start'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_blog-sudonix-com -n 50
Stack: Error: Could not communicate with Ghost
    at Server.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:91:20)
    at Object.onceWrapper (events.js:519:28)
    at Server.emit (events.js:400:28)
    at emitCloseNT (net.js:1677:8)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

In addition, I cannot even execute ghost run, which shows the below error

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '/home/sudonix/domains/blog.sudonix.com/blog/current/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I’m using v14.8 of node and nodejs, and have NodeBB installed in the root domain of https://sudonix.com. I’m attempting to install Ghost in https://blog.sudonix.com

Many thanks

ghost doctor

✔ Checking system Node.js version - found v14.18.1     
✔ 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-sudonix-com-1
? Sudo Password [hidden]                              
+ sudo systemctl reset-failed ghost_blog-sudonix-com-1 
✔ Validating config                                    
✔ Checking folder permissions                          
✔ Checking file permissions                            
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v14.18.1

Anyone able to assist with this ?

Thanks

Have you updated your ghost-cli?

I’m already using latest.

Ok, so, have you started it previously? Or is this directly after installation? Which guide specifically, did you use?

Directly after install. I’ve since found this in journalctl


Oct 21 16:49:22 vps.phenomlab.com systemd[78484]: ghost_blog-sudonix-com.service: Changing to the requested workin>Oct 21 16:49:22 vps.phenomlab.com systemd[78484]: ghost_blog-sudonix-com.service: Failed at step CHDIR spawning /u>Oct 21 16:49:22 vps.phenomlab.com systemd[1]: ghost_blog-sudonix-com.service: Main process exited, code=exited, st>Oct 21 16:49:22 vps.phenomlab.com systemd[1]: ghost_blog-sudonix-com.service: Failed with result 'exit-code'.      Oct 21 16:49:22 vps.phenomlab.com systemd[1]: ghost_blog-sudonix-com.service: Scheduled restart job, restart count>Oct 21 16:49:22 vps.phenomlab.com systemd[1]: Stopped Ghost systemd service for blog: blog-sudonix-com.            Oct 21 16:49:22 vps.phenomlab.com systemd[1]: ghost_blog-sudonix-com.service: Start request repeated too quickly.  Oct 21 16:49:22 vps.phenomlab.com systemd[1]: ghost_blog-sudonix-com.service: Failed with result 'exit-code'.      Oct 21 16:49:22 vps.phenomlab.com systemd[1]: Failed to start Ghost systemd service for blog: blog-sudonix-com.    lines 48-51/51 (END)

Makes me think it might be a permission issue. Did you 775 the ghost directory?

Yes. I tried that multiple times but it doesn’t seem to have made any difference

Check this out: Failed at step CHDIR spawning /usr/bin/node: No such file or directory

Thanks. I checked that also. The path appears to be correct

Interesting, if I use ghost config --process local then set the permissions for folder content to be the user I want, ghost starts !!

Seems it’s an issue with systemd but not sure where presently.