linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
725 stars 105 forks source link

[BUG] nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) #188

Closed alsoszaa closed 9 months ago

alsoszaa commented 10 months ago

Is there an existing issue for this?

Current Behavior

Took the docker-compose file, edited passwords and set my localhost IP address followed by the port 6875 for APP_URL and I see this constantly in the docker logs: nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

Expected Behavior

No response

Steps To Reproduce

copy and paste your compose info, edit personal data (passwords, IP address for APP_URL), docker-compose up

Environment

- OS:ubuntu 22.04
- How docker service was installed: distro's package manager

CPU architecture

x86-64

Docker creation

ran with docker-compose

Container logs

nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
github-actions[bot] commented 10 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

github-actions[bot] commented 10 months ago

A human has marked this issue as invalid, this likely happened because the issue template was not used in the creation of the issue.

j0nnymoe commented 10 months ago

Please post your actual compose (redacted personal information)

alsoszaa commented 10 months ago

—- version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment:

alsoszaa commented 10 months ago

Replaced only my passwords with “pass” for this reply. Everything else is just as it is here

alsoszaa commented 10 months ago

In the case anyone else is stuck... I found the issue. I don't use IPv6. This is explicitly added in the default sites config.

docker exec into your container then go to /config/nginx/site-confs and edit the "default.conf" file. Either remove the lines under "listen 80 ..." and "listen 443 ..." that contain the "[::]:80" and "[::]:443" or add the following to the line: listen [::]:80 ipv6only=on default_server;

Reference: https://stackoverflow.com/questions/14972792/nginx-nginx-emerg-bind-to-80-failed-98-address-already-in-use `[::]:80 is a ipv6 address.

This error can be caused if you have a nginx configuration that is listening on port 80 and also on port [::]:80.

I had the following in my default sites-available file:

listen 80; listen [::]:80 default_server; You can fix this by adding ipv6only=on to the [::]:80 like this:

listen 80; listen [::]:80 ipv6only=on default_server;`

alsoszaa commented 10 months ago

Creator of the dockerfile should not assume all users use IPv6.

aptalca commented 10 months ago

Creator of the dockerfile should not assume all users use IPv6.

We don't. In fact most of the team members don't use ipv6. I believe this issue you're facing only affects people who explicitly disable ipv6 on their os. You really don't need to.

j0nnymoe commented 10 months ago

We have both configurations in our nginx so our containers are usable in both environments. I assume this is only failing because you've specifically disabled ipv6 on your host.

drizuid commented 9 months ago

closing this as OP was explicitly disabling an entire protocol for no reason which caused the issue.

mackmoe commented 5 months ago

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

Took the docker-compose file, edited passwords and set my localhost IP address followed by the port 6875 for APP_URL and I see this constantly in the docker logs: nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

Expected Behavior

No response

Steps To Reproduce

copy and paste your compose info, edit personal data (passwords, IP address for APP_URL), docker-compose up

Environment

- OS:ubuntu 22.04
- How docker service was installed: distro's package manager

CPU architecture

x86-64

Docker creation

ran with docker-compose

Container logs

nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

For what it's worth... it was that IPV6 was disabled systemwide fore me - Everything went back to normal after I re-enabled it

drizuid commented 5 months ago

For what it's worth... it was that IPV6 was disabled systemwide fore me - Everything went back to normal after I re-enabled it

we know, thats why i said disabling the entire protocol stack, against any common judgement, was the cause just above your post...