Ghost Error: Invalid database host

Trying to start ghost via ssh on digitalocean using the command ghost start
However, I keep getting the error logs below:

+ sudo systemctl is-active ghost_blog-scholarly-africa-1

✔ Checking system Node.js version - found v16.15.0

✔ Ensuring user is not logged in as ghost user

✔ Checking if logged in user is directory owner

✔ Checking current folder permissions

+ sudo systemctl is-active ghost_blog-scholarly-africa-1

✔ Validating config

✔ Checking folder permissions

✔ Checking file permissions

✔ Checking content folder ownership

✔ Checking memory availability

✔ Checking binary dependencies

✔ Checking systemd unit file

✔ Checking systemd node version - found v16.15.0

+ sudo systemctl start ghost_blog-scholarly-africa-1

+ sudo systemctl stop ghost_blog-scholarly-africa-1

✖ Starting Ghost: blog-scholarly-africa-1

A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: Invalid database host.

Help: Please double check your database config.

Suggestion: journalctl -u ghost_blog-scholarly-africa-1 -n 50

Also when I try to access the blog via it’s custom domain, I get 502 bad gateway error.
How do I handle this?

Welcome to the community, @Uche.

Ghost can’t connect to the database, so check config.production.json, and share the output from ghost doctor.

Here’s the output from ghost doctor

✔ Checking system Node.js version - found v16.15.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_blog-scholarly-africa-1

+ sudo systemctl reset-failed ghost_blog-scholarly-africa-1

✔ Validating config

✔ 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.15.0

Please include the debug information.

You mean this:

**ghost-mgr@scholarly-blog**:**/var/www/ghost**$ sudo systemctl is-active ghost_blog-scholarly-africa-1

inactive

**ghost-mgr@scholarly-blog**:**/var/www/ghost**$ sudo systemctl reset-failed ghost_blog-scholarly-africa-1

Failed to reset failed state of unit ghost_blog-scholarly-africa-1.service: Unit ghost_blog-scholarly-africa-1.service not loaded.

**ghost-mgr@scholarly-blog**:**/var/www/ghost**$

No, I want to see what your setup looks like, i.e., host OS, database, Node etc.

Hell mjw, thanks, I got it to work by running the command sudo systemctl start ghost_blog-scholarly-africa-1.service
However, the site is showing:

“We’ll be right back.
We’re busy updating our site to give you the best experience, and will be back soon.”

Is this an issue from Ghost itself or from the installation?

I don’t know, since you haven’t provided the information requested. However, the problem is most likely related to the steps you’ve taken to install Ghost.

The message you see, is usually displayed when updating Ghost.

To start Ghost you should use ghost start.