Please let me know if it’s best I started a new thread, or contributed here, which I’ll do for now.
I self-host and upgraded using ghost update from version 3.42.2 to 4.0.1. I switched to the Caspar theme before doing so as a result of the warning I saw on attempting to upgrade. Other useful versions:
Node: v14.16.0 (also tried with v12.16.2)
Npm: 7.6.3
OS: Debian 9.13
MySQL: Ver 15.1 Distrib 10.2.30-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
I don’t believe the issue relates to the versions above because running ghost run allows the blog to start correctly (that’s the state I’ve left it in for now). At the moment I’m completely stumped and don’t know what to try next. ghost log tells me:
[2021-03-17 08:07:24] INFO Ghost is running in production...
[2021-03-17 08:07:24] INFO Your site is now available on https://blog.jonsdocs.org.uk/
[2021-03-17 08:07:24] INFO Ctrl+C to shut down
[2021-03-17 08:07:24] INFO Ghost server started in 0.833s
[2021-03-17 08:07:25] INFO Database is in a ready state.
[2021-03-17 08:07:25] INFO Ghost database ready in 1.264s
[2021-03-17 08:07:27] INFO Ghost booted in 3.536s
[2021-03-17 08:07:28] WARN Ghost is shutting down
[2021-03-17 08:07:28] WARN Ghost has shut down
[2021-03-17 08:07:28] WARN Your site is now offline
[2021-03-17 08:07:28] WARN Ghost was running for a few seconds
ghost ls advises that the blog is running, on the correct port as confirmed against my Nginx config.
I am running on a Digital Ocean droplet, Ubuntu 18.04. I’ve tried upgrading to the latest node.js version, hasn’t made any difference.
Running ghost run instead of ghost start works, implying the problem might be around permissions when running through the systemd service. I will happily help with debugging more.
I started other mentioned topic Ghost won't start after upgrading to v4.0.1 and I just resolved my issue!
If it helps anyone, I resolved my issue by completely uninstalling my failed installation and installing a fresh version 4.0.1 Fresh install failed to run automatically, but after manually running sudo systemctl start ghost_your-blog-com everything started up just fine.
If I had another chance, I’d try to just execute above command before uninstalling.
I use ghost run, but system tells me Permission denied:
[myghostuser ghost]$ ls -la /root/.nvm/versions/node/v12.18.2/bin/node
-rwxrwxrwx 1 myghostuser myghostuser 48634352 6月 30 2020 /root/.nvm/versions/node/v12.18.2/bin/node
[myghostuser ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied
I install nvm to manage my node version in root user. Should I reinstall node in this user group?
@mitkomitrovski I use ghost run , but system tells me Permission denied:
[myghostuser ghost]$ ls -la /root/.nvm/versions/node/v12.18.2/bin/node
-rwxrwxrwx 1 myghostuser myghostuser 48634352 6月 30 2020 /root/.nvm/versions/node/v12.18.2/bin/node
[myghostuser ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied
I install nvm to manage my node version in root user. Should I reinstall node in this user group?
@naz Before I upgrade to Ghost v4, ghost start is working well. Now, I am in Ghost v4, ghost start works failed. I try to ghost run to run Ghost in development, but failed again:
[myghostuser@iZ ghost]$ ghost run -D
The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
sudo: unable to execute /root/.nvm/versions/node/v12.18.2/bin/node: Permission denied
[myghostuser@iZ ghost]$ sudo node current/index.js
/var/www/ghost/versions/4.0.1/core/boot.js:46
async function initDatabase({config, logging}) {
^^^^^^^^
SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/www/ghost/versions/4.0.1/ghost.js:19:5)
Not Working for me… basically I have only this part of code there
> [Unit]
> Description=Ghost systemd service for blog: opcije-com
> Documentation=https://ghost.org/docs/
>
> [Service]
> Type=simple
> WorkingDirectory=/var/www/ghost
> User=999
> Environment=“NODE_ENV=production”
> ExecStart=/usr/bin/node /usr/bin/ghost run
> Restart=always
>
> [Install]
> WantedBy=multi-user.target
From what I can tell, everyone affected is on Node v14, and the problem is not with Node v14 itself but rather with how Node has been updated meaning Ghost is getting two different node versions.
We know the CLI is not good at catching and making these issues visible right now and it’s something we’re looking into to try to help.
If you are updating Node, it’s a really good idea to do this separately to updating Ghost to 4.0.
My recommendation for anyone updating is to do the following:
ghost version to get your current Ghost version
update node
run ghost update [ghost version] --force to do a reinstall of the current Ghost version
check everything is ok
now run ghost update to update Ghost itself
If you’ve already done the update and are running into problems, it will be easier to help if everyone starts their own threads.
Please share the normal debug info and also:
did you just update node? If so how?
output from which node
output from node --version
your systemd file
Important, take care: The output from running node --version with the full path from Exec Start in systemd, so if your ExecStart says ExecStart=/usr/bin/node /usr/bin/ghost run then share the output from running /usr/bin/node --version`
This should be a good start.
This thread was started by @halfrost and we will try to help them here. Please can anyone else who is still having problems start their own thread sharing the info I have asked for?