Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Container fails to start properly if IPv6 disabled #211

Open
TheFiZi opened this issue Oct 21, 2024 · 2 comments
Open

Container fails to start properly if IPv6 disabled #211

TheFiZi opened this issue Oct 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@TheFiZi
Copy link

TheFiZi commented Oct 21, 2024

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

💡 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

💻 Your System Details:

  • OS: Rocky Linux 8.10 (Docker Host)
  • Python Version: 3.11.0 (inside the container)

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

@TheFiZi TheFiZi added the bug Something isn't working label Oct 21, 2024
@alnviana
Copy link

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.

@disconn3ct
Copy link

For anyone doing this in k8s, you can hack it out at startup:

# Disable IPV6
lifecycle:
  postStart:
    exec:
      command: [
        "sh",
        "-c",
        "(/bin/sed -ibak -e '/::/d' /opt/apprise/webapp/etc/nginx.conf ; echo $? ; echo ran  ) | tee /tmp/ran",
      ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants