By johnstephens
I have 2 Ghost blogs on a Digital Ocean server running:
I used the instructions provided by Digital Ocean to set up the blogs, and they have worked fine and survived upgrades before.
On Saturday, I upgraded blog #1 from Ghost v0.6.0 to 0.7.0 and experienced no problems. After upgrading I ran service ghost-{blog1} restart and it came online with pomp and triumph.
I immediately attempted to upgrade blog #2 following the same steps, but when I opened it in my browser after restarting the service, I got the “502 Bad Gateway” error.
I found that npm failed to install SQLite3 correctly, and fixed that. Now, I can start the blog successfully by running npm start --production. The terminal shows that Ghost is running and intercepting requests, and I can use the site and blogging app in my browser.
But when I run service ghost-{blog2} start, it continues to fail without presenting a terminal error. I get the following message:
ghost-{blog2} start/running, process 1693
But I still see the “502 Bad Gateway” error in my browser.
<hr>
I changed my startup script to run npm start --production > ghost-{blog2}.log instead of npm start --production, and I can see that Ghost starts up, and then quits immediately without error:
> ghost@0.7.0 start /var/www/{blog2}/ghost
> node index
That’s all that is in the log, even after hitting the page a few times. Nginx logs the requests, but Ghost doesn’t.
By contrast, when I start the blog by running npm start --production > ghost-{blog2}.log from the terminal, the log continues thus:
> ghost@0.7.0 start /var/www/allder.org/ghost
> node index
Migrations: Up to date at version 004
Ghost is running in production...
Your blog is now available on http://allder.org
Ctrl+C to shut down
{{Requests}}
Can anyone suggest steps I can take to troubleshoot this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I finally solved this problem!
The answer was to downgrade Node.js to version 0.10.40. When I wrote the above, I was running node vv0.12.7.
Ghost’s install documentation says it supports v0.12.x, but when looking at it again today, I noticed that it recommends v0.10.40.
It’s not clear to me at all why this solves the problem, but I’ll take it.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.