502 Bad Gateway

Self hosted, tried to update to the latest version, and all fell apart.

Latest error:

Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database error
Suggestion: journalctl -u ghost_bilbord-rs -n 50

Debug Information:
OS: Ubuntu, v22.04.1 LTS
Node Version: v18.18.2
Ghost Version: 5.72.0
Ghost-CLI Version: 1.25.3
Environment: production
Command: ‘ghost backup’

Need help.

Common recent report - you just upgraded to node 18, right? If so, check this thread:

If that’s not it, I’d start by investigating whether mysql is running. But start with the link above. I’m betting that’s it, because I see Ghost trying to connect to the ipv6 address… which is a change from Node 16.

1 Like


No luck with

Trying to run mysql but error occurs:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO).

I also think that mysql is not running.

Looks like a root+mysql password error? You can run sudo mysql -p to get it to ask for the root password.

You can also look in the config.production.json for the user/password your blog is using to login to MySQL - and mysql -u [ghost-user] -p and enter the config password to confirm Ghost can connect to the db.

To see the status of MySQL sudo systemctl status mysql and check that it is Active.

To see if MySQL is actually running, sudo netstat -leapn | less shows all listening services on your host - if you see then MySQL is up and running.

1 Like

I have the acces and I tried with the pass, but still no:
-bash: syntax error near unexpected token `)’

sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-11-05 20:24:29 UTC; 1 day 6h ago
Process: 720 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 816 (mysqld)
Status: “Server is operational”
Tasks: 38 (limit: 2309)
Memory: 435.4M
CPU: 13min 38.881s
CGroup: /system.slice/mysql.service
└─816 /usr/sbin/mysqld

Nov 05 20:24:21 Bilbord systemd[1]: Starting MySQL Community Server…
Nov 05 20:24:29 Bilbord systemd[1]: Started MySQL Community Server.

Did you see @Cathy_Sarisky post - that is most likely the issue.

I think they are saying to change “localhost” to “” in the database section of your config.production.json

1 Like

It works!

I need it ro restart the Ghost and that is it.

Tnx a lot.

1 Like