caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
652 stars 58 forks source link

Container fails to start properly if IPv6 disabled #211

Open TheFiZi opened 1 week ago

TheFiZi commented 1 week ago

:beetle: Describe the bug With IPv6 disabled on my Docker host machine the apprise-api Docker container fails to start properly because it cannot bind to the non-existent [::]:8000 interface.

:bulb: Screenshots and Logs

Logs:

2024-10-21 03:58:04,487 INFO Set uid to user 0 succeeded

2024-10-21 03:58:04,489 INFO supervisord started with pid 28

2024-10-21 03:58:05,492 INFO spawned: 'gunicorn' with pid 29

2024-10-21 03:58:05,493 INFO spawned: 'nginx' with pid 30

2024/10/21 03:58:05 [emerg] 30#30: socket() [::]:8000 failed (97: Address family not supported by protocol)

2024-10-21 03:58:05,503 WARN exited: nginx (exit status 1; not expected)

[2024-10-21 03:58:05 +0000] [29] [INFO] Starting gunicorn 23.0.0

[2024-10-21 03:58:05 +0000] [29] [INFO] Listening at: http://0.0.0.0:8080 (29)

[2024-10-21 03:58:05 +0000] [29] [INFO] Using worker: gevent

[2024-10-21 03:58:05 +0000] [31] [INFO] Booting worker with pid: 31

[2024-10-21 03:58:05 +0000] [32] [INFO] Booting worker with pid: 32

[2024-10-21 03:58:06 +0000] [33] [INFO] Booting worker with pid: 33

[2024-10-21 03:58:06 +0000] [34] [INFO] Booting worker with pid: 34

[2024-10-21 03:58:06 +0000] [35] [INFO] Booting worker with pid: 35

2024-10-21 03:58:07,262 INFO success: gunicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2024-10-21 03:58:07,263 INFO spawned: 'nginx' with pid 36

2024/10/21 03:58:07 [emerg] 36#36: socket() [::]:8000 failed (97: Address family not supported by protocol)

2024-10-21 03:58:07,268 WARN exited: nginx (exit status 1; not expected)

2024-10-21 03:58:09,272 INFO spawned: 'nginx' with pid 37

2024/10/21 03:58:09 [emerg] 37#37: socket() [::]:8000 failed (97: Address family not supported by protocol)

2024-10-21 03:58:09,279 WARN exited: nginx (exit status 1; not expected)

2024-10-21 03:58:12,283 INFO spawned: 'nginx' with pid 38

2024/10/21 03:58:12 [emerg] 38#38: socket() [::]:8000 failed (97: Address family not supported by protocol)

2024-10-21 03:58:12,290 WARN exited: nginx (exit status 1; not expected)

2024-10-21 03:58:13,291 INFO gave up: nginx entered FATAL state, too many start retries too quickly

:computer: Your System Details:

:crystal_ball: Additional context Disable IPv6 on a your Docker Host machine Try to start the container

I think the underlying issue is that /opt/apprise/webapp/gunicorn.conf.py has '[::]:8000' and /etc/nginx/sites-enabled/default has listen [::]:80 default_server; defined and I can't see a way to disable them besides manually editing the files.

alnviana commented 5 days ago

I can confirm this problem and it is indeed for the reason pointed out by the OP, although it is not in the file /etc/nginx/sites-available/default, but in /opt/apprise/webapp/etc/nginx.conf. Removing the listen [::]:8000; from this file allows the container to start normally and the API to be requested. To fix this in my environment, I had to keep a copy of this file on the server and replace it in the container with a volume. Therefore, it would be better if there was an option to do this, as this way I will have to confirm that this file has not changed with each new version.