Ghost crashing after update

Hello,

I have a website running on Ghost v5.33.0. I want to update it to the latest version, which requires me to run ghost backup and ghost update. However, I am encountering errors that prevent me from proceeding.

When I run ghost doctor, I receive errors related to the logged-in user not being the directory owner and current folder permissions

Checking if logged in user is directory owner
:heavy_multiplication_x: Checking current folder permissions

I was able to fix these issues it buy:

And after that, ghost doctor showed that everything was alright:

however, I am unable to restart Ghost:

The last time I encountered a similar issue, I ended up completely crashing my ghost blog and couldn’t start ghost because I received the same error after running ghost start .

the recommended command doesn’t work:

how can i deal with it?))))

after server restart my website is competely down and i can’t start it

Both posts show that systemd isn’t setup correctly for the website.

Did you try ghost setup linux-user systemd?

To update ghost-cli, use this command.

sudo npm install -g ghost-cli@latest

when i put —> ghost setup linux-user systemd
i get:

i already update ghost cli to latest version, but problem still appear

also when i try ghost log i get:

Somehow, systemd is corrupt or broken. You’ll need to manually remove the entry, and try again.

I’d also double check permissions for the Ghost directory.

Incidentally, please post code snippets, not screenshots, using preformatted text button in the forum editor. It’s difficult to read screenshots, especially on mobile devices.

1 Like

Also when i try to run: ghost run -force i get:

but server start running. But when i stop command i again get

maybe there is any commands or instruction what concretly i should try?

i backup my server and now trying ghost doctor. and get this:

✔ Checking system Node.js version - found v16.19.0
✔ 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 system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_solidity-university
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✖ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.19.0
One or more errors occurred.

1) Checking if logged in user is directory owner

Message: Your user does not own the directory /var/www/uni and is also not a member of the owning group.
You must either log in with the user that owns the directory or add your user to the owning group.
Help: https://ghost.org/docs/install/ubuntu/#create-a-new-user


2) Checking current folder permissions

Message: The directory /var/www/uni is not writable by your user. You must grant write access and try again.
Help: https://ghost.org/docs/install/ubuntu/#create-a-directory


3) Checking file permissions

Message: Your installation folder contains some directories or files with incorrect permissions:
- ./.ghost-cli
- ./content/settings/routes-2023-02-02-08-54-41.yaml
- ./content/settings/routes.yaml

Is there is proper way to fix it? maybe i should start from here with another way?

if i try ls -al /var/www/uni i get

But i can’t do anythong from ghost user… i even didn’t created them

Of course, you’ll get this error if Nginx is running and Ghost is not.

As already stated, the likely issues are:

  • permissions, and
  • systemd isn’t configured correctly.

I suggest you resolve the permission problem first. The folder in /var/www should be owned by the Ghost user, and this user should have sudo privileges.

Other than correcting ownership issues, you shouldn’t use sudo. Try this:

cd /var/www
sudo chown -R ghost:ghost uni
cd uni
find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;

I have assumed your Ghost user is ghost, and you are logged in as this user.