Cannot Update Ghost

I am having a problem updating my ghost instance (running on Contabo VPS under Ubuntu 20.04). I am running version 5.34.0 and want to update to the latest version (5.96.0). The command < ghost update v5.96.0 > gives me a type error message (‘Invalid version. Must be a string. Got type “object”.’). Also i cannot backup … < ghost backup > says I do not have a running instance, and < ghost stop > says its already stopped … but its not … Website is accessible via www? Any suggestions to fix this and update to latest version.

Do you possibly have a second install of ghost? Try ghost ls and see what it says…


Just one instance shown and it says its stopped! Yet I can see and modify the website

If I try ghost start, it throws an error: “unable to determine node version”

I also checked the images and files in the content folder and confirmed that updated content is there and corresponds with the website displayed pages.

If I rebuild the site, and since I can’t run a normal backup, which files should I copy out and then is there a recommended procedure to rebuild the content?

I think you need to update Ghost CLI and run ghost update --force in the ghost installation folder.

I am using latest version of Ghost-CLI but still says that the ghost instance is not running.

Moved Post to Developer help category

Did you update Nodejs version to 20 from 18?

It cannot find the systemd file for control looks like.

systemctl list-units | grep ghost

Will show you “ghost” services active, in the case some naming is off.

Your should have a systemd service file in /lib/systemd/system/ named after your site directory like robson.service

You should also have a systemd block in your config.production.json which leads to /var/www/robson/content

yes, currently running v20 nodejs. Do I need to roll back to v18 since I am running ghost v5.34… see info from ghost doctor:
image

Then do the update first forcing v5.34, then latest version (5.??), then update nodejs??

have systemd service file:

There is also a path to content in config file:

Yes. There is a compatibility matrix here:

It confirms that 5.34 does not explicitly support Node 20.

It might work, but it’s not a supported combination.

I was originally negative about running Ghost in a container, but it solves this problem by always bundling Ghost with a supported Node version and all its dependencies.

I am about to give up … I’ve restarted the server, rolled back to nodejs v18 (using nvm) and yet I still cant stop my running instance (ghost ls says its already stopped yet its still running; accessible via www and can be changed).

Nothing left except to build a new instance, only this time in a docker Ubuntu container.

EUREKA … I think I have solved the problem. It appears that I installed nvm as root user. I followed this FAQ answer to remove nvm and reinstall it under my ghost install user: Using nvm with local and production Ghost installs

After reinstalling nvm, nodejs and ghost-CLI, “ghost ls” command now shows that ghost is running finally. so I am now able to run and backup and hopefully update to latest version.

Well, almost … I made the backup OK, but still cant update. However, I think I see the problem … the ExecStart= line in the systemd config file is not pointing to the correct node reference (still points to the old node path) … I’ll change it that and see if it works!

Still updating issue … error: ‘Invalid version. Must be a string. Got type “object”.’

1 Like

Also my webpage is not accessible via www … nginx throws a bad gateway error. I am sure its because ghost has changed the config to port 2369, but I am not an expert on NGINX and need to have someone help me open port 2369 to www …

Fixed it … I cheated and just changed port in the ghost config file and restarted ghost.

Only issue remaining is my original task … updating ghost!

SUCCESS … I had to backup, uninstall, reinstall then upload backup data but it all works now :grinning:

Reading your thread just verifies my opinion about using docker for ghost.

It’s so much easier and way less options to mess things up.
Node version bundled. No npm madness. no systemd for the service. No need for the ghost cli. Etc.

Glad you figured it out!

1 Like