mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 18:48:49 -04:00
Traefik labels not picked up when set in DDNS-updater container #256
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Plaenkler on GitHub (Feb 12, 2023).
After starting the container everything behaves normally. As soon as the web server is accessed there is HTTP 404 and the status of the container changes to unhealthy. There is nothing to see in the log.
Compose:
Log (Debug):
@jasonla commented on GitHub (Feb 14, 2023):
Minor question, did you expose the port in the compose file?
@Plaenkler commented on GitHub (Feb 14, 2023):
The container is located in the external network traefik-proxy the load balancer of Traefik listens to port 10000. Did i miss something? @jasonla Most recently, the container worked flawlessly in this constellation. Only since the last reboot it is unhealthy. Thanks for the support.
@qdm12 commented on GitHub (Jun 12, 2023):
Maybe it has to do with the trailing slash?
Can you try both the v2.5.0 and latest (pull it) image see if it's resolved today?
@Plaenkler commented on GitHub (Jun 14, 2023):
I have tried the things and continue to have the same result. Could you provide a sample configuration for Traefik?
@LachlanStone commented on GitHub (Jan 9, 2024):
Hey Everyone,
I have found a solution to get the DDNS Host to show under Traefik Reverse Proxy.
Finding:
Solution
This solution will require the use of a File Provider based mapping rather then Docker Provider . The File Method will map the DNS Domain Name to the container name. By default a docker network will have the Container name as a internal DNS Record.
DDNS Traefik File
Bellow I have provided both how to setup the File Provider under the Traefik.yml file and the Configuration
Bellow you will find a example of the Traefik Config File that I use.
DDNS File Provider Configuration
Traefik.yml Configuration File
@qdm12 commented on GitHub (Jan 19, 2024):
@Laclan Awesome thanks for the contribution! 💯
Do you have any idea why that is? Is your ddns-updater container healthy/unhealthy? 🤔
@SlavikCA commented on GitHub (Feb 14, 2024):
I have same problem: my DDNS container is not picked up by Traefik.
It was.
And now it's not.
It's not in the list of the Traefik's routers or services.
No idea why.
@SlavikCA commented on GitHub (Feb 14, 2024):
Found that my DDNS container ignored by Traefik because it's in "unhealthy" state.
And it's in "unhealthy" state because the IP changed for one of my domain. Exact reason why I have
ddns-updaterand it failed!And the error is:
...
ddns | 2024-02-15T00:04:17Z INFO [http server] listening on :8000
ddns | 2024-02-15T00:04:17Z INFO [healthcheck server] listening on 127.0.0.1:9999
ddns | 2024-02-15T00:04:17Z INFO ipv4 address of any.****.com is ..84.43 and your ipv4 address is ..72.143
ddns | 2024-02-15T00:04:17Z INFO Updating record [domain: ***.com | host: * | provider: cloudflare | ip: ipv4] to use *..72.143
ddns | 2024-02-15T00:04:18Z ERROR creating record: unsuccessful result: error 81054: A CNAME record with that host already exists. For more details, refer to https://developers.cloudflare.com/dns/manage-dns-records/troubleshooting/records-with-same-name/.;
It may be valid error, I'm still checking. But even if it can't create needed CNAME record - it shouldn't fail the healthcheck of the container.
@SlavikCA commented on GitHub (Feb 14, 2024):
also, when the container is starting, it stays in the "starting" state for about a minute. Why?
For all that duration, the container is not accessible via Traefik...
@qdm12 commented on GitHub (Feb 19, 2024):
To fix this, just disable the docker healthcheck. For example in docker-compose.yml:
You might want to also subscribe to https://github.com/traefik/traefik/issues/7842 to know when it's possible for Traefik to route to unhealthy or starting containers. Kind of weird they enable this by default 🤔
If one of the record failed to update, the container will go in unhealthy state until it succeeds again. Why shouldn't it fail the healthcheck? 🤔 (relevant code line).
You should have a CNAME or an A record for that owner, you can't have both, so that's a configuration issue, and I feel it's fine for ddns-updater to error out and go in unhealthy state, right?
The Docker healthcheck is defined by:
6a6b1a8ebb/Dockerfile (L68)So it starts at 10 seconds, and then it waits for the 60s interval. You can toy with these settings within your docker-compose.yml as well. It might be interesting to have a more regular interval, although each check performs some DNS lookups so that would be a lot of spam for short periods.
@SlavikCA commented on GitHub (Feb 19, 2024):
My understanding: the software should differentiate between container errors and app errors.
For example, if user try to access http://ddns-updater/invalid-url - that's application-level error, it should be logged, but should not result in the container health degradation.
I would think the container healthcheck should be downgraded in cases, such as lack of network connectivity (can't response to DNS requests), storage issues (can't read /write) config files, etc.
But app-level errors (such as error response from Cloudflare API) should be logged, displayed in UI, but not affect container health.
@qdm12 commented on GitHub (Feb 19, 2024):
I agree, but also it did help me a few times to see the ddns updater as unhealthy to investigate it. I guess we can have shoutrrr configured with it now, so maybe not that needed. The program should store its last kind of critical error, and serve it to the healthcheck program (the same binary ran in another mode in an ephemeral process).
Would you mind creating another issue (copy pasting your comment should do)? Thanks!
Can we then close this issue, since there is a workaround, and I would rather not remove the healthcheck to avoid breaking compatibility elsewhere? 🤔
@SlavikCA commented on GitHub (Feb 19, 2024):
Created https://github.com/qdm12/ddns-updater/issues/656
I can't close this issue. I think only @Plaenkler can (author) or maintainer.