# Ghost Update: ECONNREFUSED ::1:3306 + Error code 502

**URL:** <https://forum.ghost.org/t/ghost-update-econnrefused-3306-error-code-502/41859>\
**Category:** Developer help\
**Created:** [October 13, 2023, 7:14am UTC](https://forum.ghost.org/t/ghost-update-econnrefused-3306-error-code-502/41859 "2023-10-13T07:14:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Johny\_K](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/johny_k/32/10775_2.png) [@Johny\_K](https://forum.ghost.org/u/Johny_K)\
**Post date:** [October 13, 2023, 7:14am UTC](https://forum.ghost.org/t/ghost-update-econnrefused-3306-error-code-502/41859/1 "2023-10-13T07:14:48Z")

</div>

Just to share what problem I got after update of Ghost and Ubuntu 22.04

**What happened:**

1. Update of Linux (Ubuntu 22.04.3 LTS)

```auto
apt-get update
apt-get upgrade

```

1. Update of node:

> **[Supported node versions for self-hosted installs of Ghost](https://ghost.org/docs/faq/node-versions/)**
>
> Self-hosted installs of Ghost are recommended to use the supported node versions to ensure you don't run into any common errors. Find out more information.

1. Ghost update

Ghost-CLI version: 1.25.3  
5.66.0 → 5.69.0

Error during the update and roleback

**The problem**

Ghost was starting but didn’t work.  
After several attempts I got that Ghost couldn’t connect with the database with errors:

> Message: connect ECONNREFUSED ::1:3306

and

> Bad gateway Error code 502

**Fix**

I found fix here:

> <https://stackoverflow.com/questions/72076107/error-connect-econnrefused-13306-is-when-i-try-to-use-typeorm-in-nestjs>

So what you need to do is:

```auto
sudo nano /etc/hosts

```

Remove/comment this line from the file: - `::1`

```auto
127.0.1.1 ubuntu-8gb-ash-1 ubuntu-8gb-ash-1
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

```

This seems to be a quick workaround if anyone face it.  
Still checking what could be the reason and should be done.

---

_[View the full topic](https://forum.ghost.org/t/ghost-update-econnrefused-3306-error-code-502/41859)._
