I’m running a 1-Click Ghost droplet on Digital Ocean. It has been running but was out of date so I did an update which went smoothly. Unfortunately, now Ghost refuses to start.
I am using Ghost-CLI 1.9.9 and Ghost is currently at v2.14.3.
I can sudo to ghost-mgr (the user that Digital Ocean sets up for running ghost commands on the CLI). But when I do ghost restart or ghost start or ghost run I get:
ghost-mgr@br-2:/var/www/ghost/current$ ghost restart
Ghost-CLI commands do not work inside of a git clone, zip download or with Ghost <1.0.0.
Perhaps you meant `grunt restart`?
Otherwise, run `ghost restart` again within a valid Ghost installation.
I can confirm I am in the correct dir (via ghost ls).
When I attempt to restart npm I get the following:
ghost-mgr@br-2:/var/www/ghost$ npm restart
> ghost@3.4.0 start /var/www/ghost
> node index
module.js:549
throw err;
^
Error: Cannot find module 'ghost-ignition'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/ghost/index.js:5:13)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! Linux 4.15.0-76-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "restart"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! ghost@3.4.0 start: `node index`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ghost@3.4.0 start script 'node index'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ghost
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
but the ghost update --force gives me the same error as above:
ghost-mgr@br-2:/var/www/ghost$ ghost update --force
Ghost-CLI commands do not work inside of a git clone, zip download or with Ghost <1.0.0.
Perhaps you meant `grunt update`?
Otherwise, run `ghost update` again within a valid Ghost installation.
That helped a little, thank you. I was able to move everything except /core (permission denied). I ran ghost update anyway and got this:
ghost-mgr@br-2:/var/www/ghost$ ghost update
You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run `npm install -g ghost-cli@latest` to upgrade.
+ sudo systemctl is-active ghost_www-bogdanraczynski-com
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✖ Checking for latest Ghost version
A CliError occurred.
Message: You are about to migrate to Ghost 2.0. Your blog is not on the latest Ghost 1.0 version.
Help: Instead run "ghost update --v1".
Debug Information:
OS: Ubuntu, v18.04
Node Version: v8.10.0
Ghost-CLI Version: 1.9.9
Environment: production
Command: 'ghost update'
Additional log info available in: /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2020-02-05T02_56_36_344Z.log
running ghost update --v1 worked fine:
ghost-mgr@br-2:/var/www/ghost$ ghost update --v1
You are running an outdated version of Ghost-CLI.
It is recommended that you upgrade before continuing.
Run `npm install -g ghost-cli@latest` to upgrade.
+ sudo systemctl is-active ghost_www-bogdanraczynski-com
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✔ Checking for latest Ghost version
All up to date!
but I am still stuck on v2.14.3 and am trying to move to v3.x
ghost doctor checks out fine:
ghost-mgr@br-2:/var/www/ghost$ ghost doctor
✔ Checking system Node.js version
✔ 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 operating system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_www-bogdanraczynski-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
Thank you. That installation worked, but then another snag when I ran ghost update again:
ghost-mgr@br-2:/var/www/ghost$ ghost update
+ sudo systemctl is-active ghost_www-bogdanraczynski-com
✖ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
One or more errors occurred.
1) Checking system Node.js version
Message: The version of Node.js you are using is not supported.
Supported: ^8.16.0 || ^10.13.0 || ^12.10.0
Installed: 8.10.0
See https://ghost.org/faq/node-versions/ for more information
Debug Information:
OS: Ubuntu, v18.04.1 LTS
Node Version: v8.10.0
Ghost Version: 2.14.3
Ghost-CLI Version: 1.13.1
Environment: production
Command: 'ghost update'
It looks like your node version is out of date. Can you run node -v please? You might have multiple versions of node installed,as the output suggests you’re on an old version of node 8.x
# Set up node.js 12 (latest LTS version)
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
# Since you already have node.js installed, you need to _upgrade_ it rather than install it
sudo apt upgrade -y nodejs
...
E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting
Here is the full result of the curl command you suggested:
ghost-mgr@br-2:/var/www/ghost$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
## Installing the NodeSource Node.js 12.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://mirrors.digitalocean.com/ubuntu bionic InRelease
Hit:2 https://repos.insights.digitalocean.com/apt/do-agent-beta main InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease
Get:4 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
Hit:5 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Err:4 https://dl.yarnpkg.com/debian stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
Hit:7 https://deb.nodesource.com/node_6.x bionic InRelease
Reading package lists... Done
W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting
So what happened with the curl command is you fetched the node install script and executed it. The problem you’re running into has to do with the installation script. It runs apt update, which causes the package manager to go to every source it knows and update the list of available packages + their versions. This is how your OS will know about the new version of node. The package lists are signed to prevent malicious actors from adding their own data to the lists. You have a node v6 source in your list, but the signing key used is not available, and you have a yarn source which is not signed at all for some reason. Fixing these issues would require to edit your package sources, which I don’t really recommend for people that aren’t comfortable with the terminal
Thanks for all your help thus far! It’s greatly appreciated.
That all makes sense. I am comfortable with the terminal, just not hugely experienced with node/npm. Would you have any pointers on what file(s) need to be edited specifically please? This is just a simple digital ocean droplet and it wouldn’t be the end of the world if I had to start from scratch. I did do an export of my Ghost blog, but it’s unclear to me if that exported only my blogs or my settings as well. So if I can avoid starting from scratch I’d prefer that. But I understand if it’s inconvenient / too time-consuming for you to help.
Take a look at the files in /etc/apt/sources.list.d/. If you’re not using yarn (make sure it’s not installed as well), you can comment out the yarnpkg source. Also make sure to comment out the source that has node 6.x in it
It looks like something ran yarn install in that folder… the yarn.lock and node_modules folder shouldn’t be there. The yarn source is probably in the yarn.list file. You can add a # to any line to make it a comment