Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost process exited with code: 0 #501

Closed
1 of 2 tasks
ghost opened this issue Oct 13, 2017 · 18 comments · Fixed by #606
Closed
1 of 2 tasks

Ghost process exited with code: 0 #501

ghost opened this issue Oct 13, 2017 · 18 comments · Fixed by #606

Comments

@ghost
Copy link

ghost commented Oct 13, 2017

This issue is a

  • Bug Report
  • Feature Request

Summary

Debug Information:
    Node Version: v6.11.2
    Ghost-CLI Version: 1.1.2
    Environment: production
    Command: 'ghost start'
Message: Ghost process exited with code: 0
Stack: Error: Ghost process exited with code: 0
    at ChildProcess.cp.on (/usr/local/lib/node_modules/ghost-cli/lib/utils/local-process.js:47:24)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

Ghost won't start - just emits this unhelpful error message!

Steps to Reproduce (for a bug report)

Not sure. Usually happens after an upgrade and reboot on the server. NPM packages are rebuilt at the same time but this doesn't always fix it.

Technical details (will be automatically output by Ghost-CLI if an error occurs):

  • OS: Ubuntu 16.04
  • Node Version: 6.11.2
  • Ghost-CLI Version: 1.1.2
  • Environment:
  • Command: sudo -u ghost -H ghost start

Kate Note: Error message should be improved first. Try to improve other error messages as well.

@togume
Copy link

togume commented Oct 17, 2017

+1 on this. Happened in my local macOS build (I use for local writing). Did ghost upgrade and got this issue. My nvm works well, and I can create new local ghost instances without issues.

@acburdine
Copy link
Member

acburdine commented Oct 18, 2017

@newey01c @togume would both of you be able to try running ghost run (@togume add the --development flag because you're running it locally) and see if anything is output?

If this happens again too you might try running ghost log just to see if there are any error messages.

I'll try to add some additional logic in here to output exactly why ghost stopped - although if there is no logging output there's not much that I can do unfortunately.

@ghost
Copy link
Author

ghost commented Oct 18, 2017

There is no helpful logging output unfortunately! If there was, I'd have dug in a little bit deeper trying to diagnose the problem. I think it might be to do with knex-migrator using a local copy of the sqlite3 npm module which then doesn't get recompiled on a node upgrade (and then ghost-cli doesn't properly report the error) - but I'm not fully sure yet.

@togume
Copy link

togume commented Oct 27, 2017

@newey01c - sounds like what happened to me...

@acburdine - I'll try that next time to see what happens. What I ended up doing was - getting the sqlite3 to work with the local db that threw the error, doing a db dump, upgrading everything, importing the dump.

@whitfin
Copy link

whitfin commented Nov 9, 2017

@newey01c that appears to be accurate. I had the same issue; cd current && npm rebuild fixed it.

@Khangeldy
Copy link

In my case, this actually open my site sudo nodemon --watch content/themes/[theme name]/index.js -e hbs,js,css. But ghost not updates on changes. Another problem appear when i assign owner of content/ folder to ghost user. My Atom could not save file after changes. In this case chmod -R 777 resolve it. Then gulp throw error with permission issues. So i used sudo with it. Maybe create more elegant way to start nodemon without any trouble? IF exist reply to me. PLEASE.

@jeffreywyman
Copy link

I found that my site URL in /opt/bitnami/apps/ghost/htdocs/config.production was missing "http://" and when I changed that I resolved the error by re-running ghost update --force

@vikaspotluri123
Copy link
Member

@Khangeldy when it comes to theme development, your best bet is to install ghost locally (ghost install local) and run it locally (ghost start -D). Any changes you make to your theme will show up because caching is disabled. When you install locally, you don't need to mess with permissions - you will be running the process as your own user so permissions issues shouldn't be a thing.

I'm not sure I understand how this relates to the original issue, but feel free to correct me if I'm missing anything. If your issue doesn't specifically relate to the original issue, please check out the #help channel in the Ghost Slack chat if you have any questions! If you're looking for guidance on ghost install local, check out the local install guide.

Also, as a side note, please make sure you update the CLI to the latest version! There were some dependency changes and production improvements that will make your life easier 😜

@Khangeldy
Copy link

@vikaspotluri123 I am getting same error like this issue. When i start ghost start -D i got Ghost process exited with code: 0 . I am already installed ghost locally. And it's tutorial saying that to create ghost user and gain folder owner to him. Under developing theme section .

@kirrg001
Copy link
Contributor

kirrg001 commented Nov 23, 2017

@acburdine

This looks like a mixture of reports.

I think it might be to do with knex-migrator using a local copy of the sqlite3 npm module which then doesn't get recompiled on a node upgrade (and then ghost-cli doesn't properly report the error) - but I'm not fully sure yet.

This should be fixed!?

I found that my site URL in /opt/bitnami/apps/ghost/htdocs/config.production was missing "http://" and when I changed that I resolved the error by re-running ghost update --force

Not sure how it's possible to enter a URL without protocol, there is a url validation. If it was manually edited cc @jeffreywyman, the CLI could detect a incorrect url format.


@Khangeldy Hard to guess why you are running into the problem. Could you double check the comments and see if any of the suggestions fixes your problem? Share as much as you can and upgrade to the latest CLI version.

@kirrg001 kirrg001 self-assigned this Jan 13, 2018
@kirrg001
Copy link
Contributor

  • Error message should be improved first

@kirrg001 kirrg001 assigned aileen and unassigned kirrg001 Jan 15, 2018
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Feb 2, 2018
closes TryGhost#501
- if the content folder is owned by a separate user, the local process manager will fail
- improve local process manager errors
- add local process manager tests
@acburdine acburdine assigned acburdine and unassigned aileen Feb 2, 2018
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Feb 2, 2018
closes TryGhost#501
- if the content folder is owned by a separate user, the local process manager will fail
- improve local process manager errors
- add local process manager tests
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Feb 3, 2018
closes TryGhost#501
- if the content folder is owned by a separate user, the local process manager will fail
- improve local process manager errors
- add local process manager tests
acburdine added a commit that referenced this issue Feb 3, 2018
closes #501
- if the content folder is owned by a separate user, the local process manager will fail
- improve local process manager errors
- add local process manager tests
@restuarifp
Copy link

I have similar issue with the same error message. In my case, when I rename folder name other than "ghost". When I rename it back to "ghost", everything goes back to normal.

  • OS: Mac OS 10.14.1
  • Node Version: 8.12.0
  • Ghost-CLI Version: 1.9.8
  • Environment: Development
  • Command: ghost start

@pfist
Copy link

pfist commented Dec 13, 2018

I encountered this problem today when I attempted to upgrade Ghost from 2.6.x to 2.8.0 before upgrading Ghost CLI. After trying a few different things, running ghost update --force appears to have solved it.

Worth noting: When I ran ghost update --force the last step said "Restarting Ghost" even though the instance didn't appear to be running. Might be related.

Debug Info

  • OS: Microsoft Windows, v10.0.17763
  • Node Version: v10.14.2
  • Ghost-CLI Version: 1.9.8
  • Environment: development
  • Command: ghost start

@shriker
Copy link

shriker commented Jan 4, 2019

I ran into this today and it was due to my current/ symlink being broken. Running ghost update --force fixed the broken link.

@chrishawn
Copy link

chrishawn commented Aug 14, 2019

OK so i was able to fix this on macos by doing
brew uninstall --force binutils
more on how/why here: https://stackoverflow.com/questions/54014971/macos-dyld-symbol-not-found-usdt-create-provider

@chansecampbell
Copy link

This is still an issue when the folder name is changed after initialising

@brownpl
Copy link

brownpl commented Mar 25, 2020

Not sure if this helps, but if you are running locally, after I renamed the install folder and I needed to also review my config.development.json file as it was still pointed to the old path for the sqlite file.

@ericgopak
Copy link

ericgopak commented Apr 26, 2020

Happened to me too, after I've copied a production config file to my local Ghost instance (before that I only had development.config.json).
First I was surprised by tons of complaints regarding file/folder permissions which I didn't have before, and fixing those permissions didn't resolve the issue.

What helped me was to simply run ghost start --development instead of my previously run ghost start). Now it's working again.

P.S. My setup is on Windows 8.1 with Cygwin, using node v10.13.0 with nvm

P.P.S. Most likely unrelated, but I've also run npm install from the /current folder before it started working again. Just in case I broke something somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.