coollabsio / coolify

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

[Bug]: failed to create new listening socket: socket(): Address family not supported by protocol (97) #4037

Open fn-hide opened 1 month ago

fn-hide commented 1 month ago

Error Message and Logs

in docker:

CONTAINER ID   IMAGE                                       COMMAND                  CREATED          STATUS                      PORTS                                                                                    NAMES
0a68e10e1a3e   ghcr.io/coollabsio/coolify:4.0.0-beta.360   "/init"                  51 minutes ago   Up 13 minutes (unhealthy)   443/tcp, 8000/tcp, 9000/tcp, 0.0.0.0:8000->80/tcp                                        coolify
f9dd4e99aad9   postgres:15-alpine                          "docker-entrypoint.s…"   51 minutes ago   Up 51 minutes (healthy)     5432/tcp                                                                                 coolify-db
2085c5fb5861   redis:alpine                                "docker-entrypoint.s…"   51 minutes ago   Up 51 minutes (healthy)     6379/tcp                                                                                 coolify-redis
44ca195934eb   ghcr.io/coollabsio/coolify-realtime:1.0.3   "/bin/sh /soketi-ent…"   51 minutes ago   Up 51 minutes (healthy)     0.0.0.0:6001-6002->6001-6002/tcp                                                         coolify-realtime
954ca4f1edcf   traefik:v3.1                                "/entrypoint.sh --pi…"   58 minutes ago   Up 58 minutes (healthy)     0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:443->443/udp   coolify-proxy

in specific unhealty coolify logs:

[28-Oct-2024 03:38:50] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[28-Oct-2024 03:38:50] ERROR: failed to create new listening socket: socket(): Address family not supported by protocol (97)
[28-Oct-2024 03:38:50] ERROR: FPM initialization failed
[28-Oct-2024 03:38:50] ERROR: FPM initialization failed

Steps to Reproduce

  1. Just install coolify on fresh ubuntu server.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.360

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.04.1

Additional Information

Same issue with this

fn-hide commented 1 month ago

This error is caused by docker not coolify. Solved by enable ipv6 in my Ubuntu server. Thanks to this, this, and this.

Here the step-by-step if you all encounter the same issue:

To enable IPv6 on your Ubuntu 19.04 system, you can follow these steps: Check Current IPv6 Status: First, check if IPv6 is already enabled or not by running:

ip a | grep inet6

If you see addresses listed, IPv6 is enabled. If not, proceed to the next steps. Edit the GRUB Configuration: You may need to edit the GRUB configuration file to enable IPv6. Open the file using your preferred text editor:

sudo nano /etc/default/grub

Look for the line that starts with GRUB_CMDLINE_LINUX_DEFAULT and ensure it does not contain ipv6.disable=1. If it does, remove that part or set it to 0. The line might look like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Update GRUB: After making changes, update GRUB to apply them:

sudo update-grub

Edit sysctl Configuration: To ensure IPv6 is enabled at boot, you can edit the sysctl configuration:

sudo nano /etc/sysctl.conf

Add or uncomment the following lines:

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0

Apply sysctl Changes: Apply the changes by running:

sudo sysctl -p

Restart Your System: Reboot your system for all changes to take effect:

sudo reboot

Verify IPv6 is Enabled: After the reboot, check again:

ip a | grep inet6

If you see IPv6 addresses listed, then it is successfully enabled. After enabling IPv6, you can check if the Coolify Docker container is running correctly without the socket error. If you continue to face issues, please provide the specific errors or behaviors you encounter.

peaklabs-dev commented 4 days ago

@fn-hide Just out of interest, can you run docker --version and tell me what Docker version you are running? Because I think this is related to older version of docker.

thesethtruth commented 4 days ago

@peaklabs-dev as per your request in #4351:

Docker version: Docker version 27.3.1, build ce12230

OS: Ubuntu 24.04.1 LTS

Coolify version v4.0.0-beta.370

(for everyone else that reads this thread in the future, my issues with FPM initialization were solved by changing my IPv6 settings much like the comment above)

fn-hide commented 3 days ago

@peaklabs-dev Docker version 26.0.2, build 3c863ff