Systemd process manager has not been set up or is corrupted

Hello,

I have ghost v5.19.3 hosted on amazon EC2 with node v16.18.0 and everything was working fine till I needed to update my mail options in config.production.json and ran ghost restart and then I keep getting this error

+ sudo systemctl is-active ghost_3-82-93-107
✖ Restarting Ghost
A SystemError occurred.

Message: Systemd process manager has not been set up or is corrupted.
Help: Run ghost setup linux-user systemd and try again.

Debug Information:
    OS: Ubuntu, v18.04.6 LTS
    Node Version: v16.18.0
    Ghost Version: 5.19.3
    Ghost-CLI Version: 1.23.1
    Environment: production
    Command: 'ghost restart'

Try running ghost doctor to check your system for known issues.

I tried to run setup linux-user systemd but I get same response

Systemd service has already been set up. Skipping Systemd setup
ℹ Setting up Systemd [skipped]

and now I am stuck and I don’t know what I should do , I tried to go through the similar conversation but I don’t think I have same problem

I ran ls -l and everything looks fine

total 12
-rw-rw-r--  1 blog blog  762 Nov  5 16:45 config.production.json
drwxrwxr-x 11 blog blog 4096 Oct 20 22:42 content
lrwxrwxrwx  1 blog blog   29 Oct 20 22:44 current -> /var/www/blog/versions/5.19.3
drwxrwxr-x  3 blog blog 4096 Oct 20 22:42 versions

So what should I do now ? or what am I missing ?
Thanks a lot in advance.

What does ghost doctor show?

That’s the output of ghost doctor @mjw


✔ Checking system Node.js version - found v16.18.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
+ sudo systemctl is-active ghost_3-82-93-107
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.18.0

…and the output from ghost ls. Also, do you take backups, and snapshots on your host?

And no, I don’t have backups

This implies that the Ghost service is running. So, what happens when you open the website in a browser? And, what about ghost stop?

Incidentally, that’s the IP address: Ghost should run on localhost behind an Nginx proxy. The server returned bad gateway, 502, and the Ghost port times-out, so most likely the config is broken.

This is reckless. Ghost CLI includes a backup option, which you should run before an update. But you also need off-server backups.

I think I’d be inclined to build a new Ghost instance, migrate the contents folder, and then remove the old instance once this is working. You’ll also need your theme (.zip file), and add custom routes, redirects, and config. Everything else is in the database.