linuxserver/docker-bookstack

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

alsoszaa opened this issue · 12 comments

Is there an existing issue for this?

  • 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)

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

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

Please post your actual compose (redacted personal information)

—-
version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=https://172.28.0.32:6875
- DB_HOST=bookstack_db
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASS=pass
- DB_DATABASE=bookstackapp
volumes:
- ./bookstack_app_data:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb
container_name: bookstack_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=pass
- TZ=America/Los_Angeles
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=pass
volumes:
- ./bookstack_db_data:/config
restart: unless-stopped

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

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;`

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

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.

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.

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

Is there an existing issue for this?

  • 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

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...