Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: bind() to 0.0.0.0:80 failed (13: Permission denied) #4601

Closed
darkterminal opened this issue Dec 16, 2024 · 6 comments · Fixed by #4649
Closed

[Bug]: bind() to 0.0.0.0:80 failed (13: Permission denied) #4601

darkterminal opened this issue Dec 16, 2024 · 6 comments · Fixed by #4649

Comments

@darkterminal
Copy link

Error Message and Logs

I just did upgrade from 4.0.0-beta.378 to 4.0.0-beta.379

2024/12/16 15:09:01 [emerg] 1686#1686: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:02 [emerg] 1692#1692: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Could not connect to server
  2024-12-16 15:09:02 App\Jobs\ServerCheckJob ........................ RUNNING
  2024-12-16 15:09:02 App\Jobs\ServerCheckJob .................. 286.55ms DONE
2024/12/16 15:09:03 [emerg] 1709#1709: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Could not connect to server
❌ There seems to be a failure in checking the NGINX + PHP-FPM.
curl: (7) Failed to connect to localhost port 8080 after 0 ms: Could not connect to server
2024/12/16 15:09:04 [emerg] 1718#1718: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:05 [emerg] 1723#1723: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:06 [emerg] 1728#1728: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:07 [emerg] 1733#1733: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:08 [emerg] 1745#1745: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:09 [emerg] 1750#1750: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:11 [emerg] 1755#1755: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:12 [emerg] 1760#1760: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:13 [emerg] 1765#1765: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:14 [emerg] 1777#1777: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:15 [emerg] 1782#1782: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:16 [emerg] 1787#1787: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:17 [emerg] 1794#1794: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:18 [emerg] 1799#1799: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:19 [emerg] 1811#1811: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:20 [emerg] 1816#1816: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:21 [emerg] 1821#1821: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:22 [emerg] 1826#1826: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:23 [emerg] 1831#1831: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:24 [emerg] 1843#1843: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:25 [emerg] 1848#1848: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:26 [emerg] 1853#1853: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:27 [emerg] 1858#1858: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:28 [emerg] 1863#1863: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:29 [emerg] 1875#1875: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:30 [emerg] 1880#1880: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:31 [emerg] 1885#1885: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:32 [emerg] 1890#1890: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:33 [emerg] 1895#1895: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:34 [emerg] 1907#1907: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:35 [emerg] 1912#1912: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:36 [emerg] 1917#1917: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:37 [emerg] 1923#1923: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:38 [emerg] 1928#1928: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:39 [emerg] 1940#1940: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:40 [emerg] 1945#1945: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:41 [emerg] 1950#1950: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:42 [emerg] 1955#1955: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:43 [emerg] 1960#1960: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:44 [emerg] 1973#1973: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
2024/12/16 15:09:45 [emerg] 1978#1978: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

After that I downgrade the version back to 4.0.0-beta.378. But the error still same.

Steps to Reproduce

  1. Upgrade from 4.0.0-beta.378 to 4.0.0-beta.379 from dashboard -> crash
  2. Upgrade from 4.0.0-beta.378 to 4.0.0-beta.379 manually -> crash
  3. Downgrade from 4.0.0-beta.379 to 4.0.0-beta.378 manually -> crash
  4. I still can access the coolify instance

Example Repository URL

No response

Coolify Version

4.0.0-beta.379

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04.5 LTS

Additional Information

No response

@darkterminal darkterminal added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Dec 16, 2024
@peaklabs-dev
Copy link
Member

Please run the installation script again this should help fix the issues: curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash

@JanUlrichR
Copy link

JanUlrichR commented Dec 16, 2024

Hey, my setup was running on a system where I am not able to run the install script (Synology). Do you by any chance know what I need to change the? (I am using manual install)
Ps I would be glad to help getting the install script up and running also for Synology devices.

@darkterminal
Copy link
Author

Now It's fix! How?

Diagnosis

  • NGINX is running as part of a custom process or inside a Docker container, not as a systemd service (nginx.service).
  • Coolify managing NGINX and PHP-FPM via scripts, which is why I cannot use typical commands to stop or restart it.

The error bind() to 0.0.0.0:80 failed (13: Permission denied) inside the container typically indicates a permission issue when attempting to bind NGINX to port 80.

Cz Docker environments processes is not running as root or privileged.

So am going inside the coolify container as a root:

docker run -it --user root <image_name> sh

And I need libcap to use setcap command and allow NGINX to bind to privileged ports.

apk add libcap # cz Coolify Docker container is based on Alpine-based images
setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx

After that, am restart the NGINX (from inside coolify container):

nginx -s reload

and test if configuration is passed successfully

nginx -t

Wow... I am panic when I can't access my Coolify dashboard!

@github-actions github-actions bot removed 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Dec 16, 2024
@peaklabs-dev peaklabs-dev reopened this Dec 16, 2024
@peaklabs-dev peaklabs-dev self-assigned this Dec 16, 2024
@peaklabs-dev peaklabs-dev added 🐞 Confirmed Bug Verified issues that have been reproduced by the team. 🐛 Bug Reported issues that need to be reproduced by the team. and removed 🐞 Confirmed Bug Verified issues that have been reproduced by the team. labels Dec 16, 2024
@peaklabs-dev peaklabs-dev added this to the v4.0.0 Stable Release milestone Dec 16, 2024
@automatethething
Copy link

[NOTICE]: Running custom command instead of web server configuration: 'sh'
/var/www/html # apk add libcap # cz Coolify Docker container is based on Alpine-based images
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
(1/5) Installing libcap2 (2.70-r0)
(2/5) Installing libcap-getcap (2.70-r0)
(3/5) Installing libcap-setcap (2.70-r0)
(4/5) Installing libcap-utils (2.70-r0)
(5/5) Installing libcap (2.70-r0)
Executing busybox-1.36.1-r29.trigger
OK: 99 MiB in 106 packages
/var/www/html # setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx
/var/www/html # nginx -s reload
nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
/var/www/html # nginx -t
nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed
/var/www/html # ls /etc/nginx/
conf.d fastcgi_params modules scgi_params site-opts.d uwsgi_params
fastcgi.conf mime.types nginx.conf.template server-opts.d sites-available
/var/www/html #

@github-actions github-actions bot removed the 🐛 Bug Reported issues that need to be reproduced by the team. label Dec 17, 2024
@peaklabs-dev peaklabs-dev changed the title [Bug]: I can't access coolify instance after upgrade [Bug]: bind() to 0.0.0.0:80 failed (13: Permission denied) Dec 17, 2024
@andrasbacsai
Copy link
Member

Let me know if the update fixes your issue.

@darkterminal
Copy link
Author

It's works!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants