/ ghost

Updating Ghost on Openshift and "Failed to execute control start" Error

Updating Ghost to the latest version (v0.9) is easy using Openshift!

Openshift provides an excellent (and free!) platform to host your Ghost blog, and installation is made easy with Cartridges like Ghost for Openshift Quickstart. That being said, you will likely not have the most recent version of Ghost and want to upgrade to get all the latest goodies. Fortunately, this is actually a fairly simple process!

Openshift Logo

You can find an excellent guide here, but I wanted to outline my own experience and the problems I encountered in case it might help someone in the future. If you just want to see quickly how to update, scroll to the next section of this page.

Note that this assumes you know how to Git Clone your App and push updates. If you don't, see a post that covers all of that here.


Failed to execute 'control restart'

Before finding this page, I attempted to update Ghost manually by git cloning my page, replacing all the Ghost files, and pushing that live.

When I did so, my blog failed to start. It got all the way to restarting the app and I got an error that looked like this:

Failed to execute: 'control restart' for /var/lib/app_root/myID/index.js

Long story short, my package.json file was incorrect.

This can be a little confusing because there are actually two package.json files in your Openshift gear. The first is right in your app's root directory, used presumably for the Quickstart cartridge. The second is under /node_modules/ghost/, and this is the one that was causing errors.

If you run into this problem, open up /node_modules/ghost/package.json and find the line that reads "main": "./core/index" or something like that. This line is what's causing you problems.

Basically index needs to have the extension attached to it apparently. so you need to make sure this will always read index.js. This is true if the file is named something else as well.

If you are experiencing this problem and cannot start your app, make sure this is set correctly and try pushing the update using git. If you're still experiencing problems, try removing the filepath as well so the line reads "main": "index.js".


Updating Ghost

So if you've fixed your problem, or never had a problem and want to see how to update, then you're in luck because it is easy!

Backup!

First I must emphasize that you HAVE to back up. Just in case. Back up both your Ghost Blog and your whole Openshift gear.

  • Go into your Ghost Blog Labs and export your blog

  • Make a snapshot of your cartridge that you can restore to if you need to.

Update!

Okay, so all that you need to change is the package.json file right in your App's root directory. This is not the same file that is found further into the app ( under /node_modules/ghost/ ). There should only be a short number of lines in this file.

Under dependencies, you will see a line that reads:

"ghost": "^x.x.x"

Simply change those 3 numbers to the current Ghost version. At the time of writing, this is 0.8.0, but this should continue to work for future versions.

Once that is changed, run the update command:

npm update

This will automatic update all the necessary Ghost files!

Push!

Finally, run git add/commit/push to push your update onto your server and automatically restart your app with your new Ghost Version :)

Again, if you are unsure how to go about this, check out this blog post.

Now hopefully, when your App restarts you will have the newest Ghost version running and everything will be fine! If you want to check to make sure, in your Ghost dashboard click on the top left button (which will be your Ghost Blog name) and click "About Ghost". Under this page you will be able to see the current version of Ghost running.

Kyle

Kyle

I do tactile research—It's a touchy subject. Psych/Neuro grad student and creator of LittleGadget, a channel about Science and Videogames.

Read More