coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
34.46k stars 1.87k forks source link

[Bug]: PSQL - connection to server at "{IP}", port 5444 failed: Connection refused #2556

Open SSardorf opened 5 months ago

SSardorf commented 5 months ago

Description

So when I setup a postgres database, and make it publicly accessible, it works for five minutes, and I am able to properly connect, but then afterwards it starts giving the following error when I try to connect:

psql: error: connection to server at "MY IP", port 5444 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?

Minimal Reproduction (if possible, example repository)

No repo - Using the template

Exception or Error

psql: error: connection to server at "MY IP", port 5444 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?

Version

v4.0.0-beta.297

SSardorf commented 5 months ago

Also won't let me connect to the internal url - Even from within the VPS. It's like the postgres db just shuts down - Even though it says it's still running.

If I restart it, it starts working again, but five minutes later it'll be down.

SSardorf commented 5 months ago

Here's a link to the discord thread where we've been exploring this issue: https://discord.com/channels/459365938081431553/1251447331396653116

SSardorf commented 5 months ago

Actually seems like it's a proxy issue.

The full proxy logs are:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/06/15 08:47:17 [notice] 1#1: using the "epoll" event method
2024/06/15 08:47:17 [notice] 1#1: nginx/1.26.1
2024/06/15 08:47:17 [notice] 1#1: built by gcc 13.2.1 20231014 (Alpine 13.2.1_git20231014) 
2024/06/15 08:47:17 [notice] 1#1: OS: Linux 5.15.0-100-generic
2024/06/15 08:47:17 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/06/15 08:47:17 [notice] 1#1: start worker processes
2024/06/15 08:47:17 [notice] 1#1: start worker process 30
2024/06/15 08:47:17 [notice] 1#1: start worker process 31
2024/06/15 08:47:17 [notice] 1#1: start worker process 32
2024/06/15 08:47:17 [notice] 1#1: start worker process 33
2024/06/15 08:47:17 [notice] 1#1: start worker process 34
2024/06/15 08:47:17 [notice] 1#1: start worker process 35
2024/06/15 08:47:17 [notice] 1#1: start worker process 36
2024/06/15 08:47:17 [notice] 1#1: start worker process 37
2024/06/15 08:47:17 [notice] 1#1: start worker process 38
2024/06/15 08:47:17 [notice] 1#1: start worker process 39
2024/06/15 08:47:17 [notice] 1#1: start worker process 40
2024/06/15 08:47:17 [notice] 1#1: start worker process 41

But when it stops accepting connections, it lines up with

2024/06/15 08:47:17 [notice] 1#1: using the "epoll" event method
2024/06/15 08:47:17 [notice] 1#1: nginx/1.26.1
2024/06/15 08:47:17 [notice] 1#1: built by gcc 13.2.1 20231014 (Alpine 13.2.1_git20231014) 
2024/06/15 08:47:17 [notice] 1#1: OS: Linux 5.15.0-100-generic
2024/06/15 08:47:17 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/06/15 08:47:17 [notice] 1#1: start worker processes
2024/06/15 08:47:17 [notice] 1#1: start worker process 30
2024/06/15 08:47:17 [notice] 1#1: start worker process 31
2024/06/15 08:47:17 [notice] 1#1: start worker process 32
2024/06/15 08:47:17 [notice] 1#1: start worker process 33
2024/06/15 08:47:17 [notice] 1#1: start worker process 34
2024/06/15 08:47:17 [notice] 1#1: start worker process 35
2024/06/15 08:47:17 [notice] 1#1: start worker process 36
2024/06/15 08:47:17 [notice] 1#1: start worker process 37
2024/06/15 08:47:17 [notice] 1#1: start worker process 38
2024/06/15 08:47:17 [notice] 1#1: start worker process 39
2024/06/15 08:47:17 [notice] 1#1: start worker process 40
2024/06/15 08:47:17 [notice] 1#1: start worker process 41
saeedesmaili commented 4 months ago

Were you able to find a solution for this? I have the same issue.

SSardorf commented 3 months ago

Were you able to find a solution for this? I have the same issue.

No, I haven't found a solution to this. Not sure what causes it. But seems to be related to the Traefik proxy