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

v0.2.6 Docker 27.3.1 | Error: Unable to fetch zone ID for domain xyz.de #20

Closed
Crash1602 opened this issue Dec 12, 2024 · 9 comments
Closed

Comments

@Crash1602
Copy link

Crash1602 commented Dec 12, 2024

Hello,

I have an issue with version 0.2.6 where I receive the following error message:

[2024-12-12 11:57:29] Started Hetzner DDNS daemon
[2024-12-12 11:57:29] Reading configuration from /etc/hetzner_ddns.conf
[2024-12-12 11:57:29] Error: Unable to fetch zone ID for domain xyz.de
[2024-12-12 11:58:00] Retrying to fetch zone and record data
[2024-12-12 11:58:00] Error: Unable to fetch zone ID for domain xyz.de
[2024-12-12 11:58:31] Retrying to fetch zone and record data
[2024-12-12 11:58:31] Error: Unable to fetch zone ID for domain xyz.de
[2024-12-12 11:59:02] Retrying to fetch zone and record data
[2024-12-12 11:59:02] Error: Unable to fetch zone ID for domain xyz.de
[2024-12-12 11:59:33] Retrying to fetch zone and record data

This is what my hetzner_ddns.conf looks like:

# Seconds between updates / TTL value
interval='60'

# Hetzner DNS API key
key='arevaregFTHFbarfgdtshtDZRTbfgs'

# Top level domain name
domain='xyz.de'

# Space separated host subdomains (@ for domain itself)
records='test test2 test3'

# Enable updating A records (IPv4)
ipv4=true

# Enable updating AAAA records (IPv6)
ipv6=true

The relevant part of my stack:

# xyz.de DDNS  
  xyz:
    image: filiparag/hetzner_ddns:0.2.6
    container_name: 'hetznerddns-xyz'
    environment:
      - TZ=Europe/Berlin
    restart: unless-stopped
    volumes:
      - /var/lib/docker/volumes/hetznerddns-xyz-prod/_data/hetzner_ddns.conf:/etc/hetzner_ddns.conf:ro #ReadOnly
    network_mode: host

With version 0.2.5, I don't have a problem with any of my four containers. As soon as I update the config file and include 0.2.6, I get the error on all four of them.

What could be causing this?

Thanks!

@filiparag
Copy link
Owner

Your configuration files seem okay. New version 0.2.6 doesn't modify any of zone ID fetching code, so I'm not sure why it breaks after upgrading from 0.2.5.

I would suggest you pin the version to 0.2.5 for now, and let's see if anyone else encounters the same issue.

@Crash1602
Copy link
Author

Crash1602 commented Dec 13, 2024

I have just tested a container on another Docker host (same Version and System-Config) with version DDNS 0.2.6 using the current configuration including IPv4 and IPv6 parameters. There is no 'fetch' error there.

Unfortunately, this does not give me a new idea where the cause might lie.

Edit:
An obvious difference is that the production host has significantly more network interfaces, while the test system has only a few. Could it be that version 0.2.6 is possibly addressing the wrong interface and therefore causing the Fetch ZoneID error?

Edit: 2
Gives a debug log that I can enable?

@filiparag
Copy link
Owner

Gives a debug log that I can enable?

There is no option for additional debugging information, as this is a fairly simple utility. However, you might try manually running curl commands this script uses inside and outside the container to see what causes the issue.

@Crash1602
Copy link
Author

Crash1602 commented Dec 14, 2024

Thank you very much for your help. I executed the command / # curl "https://dns.hetzner.com/api/v1/zones" -H "Auth-API-Token: WjcswEAFaASdsdasdasd" on the host and in the Docker container.

  1. On the Docker host, all information could be retrieved (2450 characters).
  2. In a Docker container with version 0.2.5, all information could be retrieved (2450 characters).
  3. In a Docker container with version 0.2.6, I receive the error curl: (6) Could not resolve host: dns.hetzner.com

An nslookup within a container running version 0.2.6 works:

/ # nslookup dns.hetzner.com

Non-authoritative answer:
Name:   dns.hetzner.com
Address: 159.69.255.131

Non-authoritative answer:
Name:   dns.hetzner.com
Address: 2a01:4f8:c010:c083::1

If the name can be resolved in the same container, then it should also be resolvable by the script :-/

@Crash1602
Copy link
Author

When I specify the DNS parameters as follows, fetching the ZoneIDs works during the runtime of the script with version 0.2.6.

The script seems not to be querying the correct DNS servers during runtime.

# xyz.de DDNS  
  xyz:
    image: filiparag/hetzner_ddns:0.2.6
    container_name: 'hetznerddns-xyz'
    dns:
     - 8.8.8.8
     - 1.1.1.1
    environment:
      - TZ=Europe/Berlin
    restart: unless-stopped
    volumes:
      - /var/lib/docker/volumes/hetznerddns-xyz-prod/_data/hetzner_ddns.conf:/etc/hetzner_ddns.conf:ro #ReadOnly
    network_mode: host

@BallonLac
Copy link

BallonLac commented Dec 15, 2024

Just tested with straight docker_compose.yml file from project, working fine here.
@Crash1602 you may have a Docker problem.

@Crash1602
Copy link
Author

you may have a Docker problem.

@BallonLac That is possible, and I do not want to rule it out. Do you have any idea where I could start with the troubleshooting? At the moment, I have none, and I don't understand the difference between the working nslookup and the curl command during runtime. I would have assumed that the same DNS server would be accessed during runtime :-/

Thanks for your help.

@BallonLac
Copy link

@Crash1602 you may dig about "network_mode: host" option: https://docs.docker.com/reference/compose-file/services/#network_mode.
What gives commenting it out?

@Crash1602
Copy link
Author

#network_mode. What gives commenting it out?

@BallonLac That was a good idea. I test it and commented out the host mode, assigning my custom bridge network instead. The retrieval works, and no error is generated. I just checked the Docker repository, and it seems that the bridge mode is also the recommended option, which avoids any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants