qdm12 / ddns-updater

Container to update DNS records periodically with WebUI for many DNS providers
https://hub.docker.com/r/qmcgaw/ddns-updater/
MIT License
1.46k stars 146 forks source link

Docker does not read/update from config.json #640

Closed jehlybean closed 4 months ago

jehlybean commented 4 months ago

TLDR: Describe your issue in a one liner here

I've set up the config.json several times and it wont update when I check the webui.

I recently rebuilt a corrupt docker.img and it was working perfectly before.

  1. Is this urgent: No

  2. DNS provider(s) you use: Cloudflare

  3. Program version:

    Running version latest built on 2020-03-13T01:30:06Z (commit d0f678c)

  4. What are you using to run the container: unraid

  5. Extra information (optional)

Logs:

Running version latest built on 2024-02-04T14:45:13.409Z (commit 133956f)

πŸ”§ Need help? https://github.com/qdm12/ddns-updater/discussions/new
πŸ› Bug? https://github.com/qdm12/ddns-updater/issues/new
✨ New feature? https://github.com/qdm12/ddns-updater/issues/new
β˜• Discussion? https://github.com/qdm12/ddns-updater/discussions/new
πŸ’» Email? quentin.mcgaw@gmail.com
πŸ’° Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2024-02-08T01:32:00Z INFO Settings summary:
β”œβ”€β”€ HTTP client
|   └── Timeout: 10s
β”œβ”€β”€ Update
|   β”œβ”€β”€ Period: 5m0s
|   └── Cooldown: 5m0s
β”œβ”€β”€ Public IP fetching
|   β”œβ”€β”€ HTTP enabled: yes
|   β”œβ”€β”€ HTTP IP providers
|   |   └── all
|   β”œβ”€β”€ HTTP IPv4 providers
|   |   └── all
|   β”œβ”€β”€ HTTP IPv6 providers
|   |   └── all
|   β”œβ”€β”€ DNS enabled: yes
|   β”œβ”€β”€ DNS timeout: 3s
|   └── DNS over TLS providers
|       └── all
β”œβ”€β”€ Resolver: use Go default resolver
β”œβ”€β”€ Server
|   β”œβ”€β”€ Listening address: :8000
|   └── Root URL: /
β”œβ”€β”€ Health
|   └── Server listening address: 127.0.0.1:9999
β”œβ”€β”€ Paths
|   └── Data directory: /updater/data
β”œβ”€β”€ Backup: disabled
└── Logger
    β”œβ”€β”€ Level: info
    └── Caller: hidden
2024-02-08T01:32:00Z INFO reading JSON config from file /updater/data/config.json
2024-02-08T01:32:00Z WARN Found no setting to update record
2024-02-08T01:32:00Z INFO [backup] disabled
2024-02-08T01:32:00Z INFO [http server] listening on :8000
2024-02-08T01:32:00Z INFO [healthcheck server] listening on 127.0.0.1:9999

Host OS: Unraid

qdm12 commented 4 months ago
2024-02-08T01:32:00Z INFO reading JSON config from file /updater/data/config.json
2024-02-08T01:32:00Z WARN Found no setting to update record

Check the config.json file is bind mounted correctly? It seems it doesn't find it (so it creates it as empty)

jehlybean commented 4 months ago

It created an empty file which I later filled. How do I verify if bind is mounted? I followed each step.

qdm12 commented 4 months ago

Where is your config.json file on your host system, and what's your bind mount configured for the /updater/data directory?

jehlybean commented 4 months ago

/mnt/user/appdata/ddns-updater/data I don’t follow on bind mount - is that the β€œtouch” command? I followed each line from the unraid instructions exactly.

qdm12 commented 4 months ago

You should a volume mount (aka bind mount) between /mnt/user/appdata/ddns-updater/data (on your host system) and /updater/data (in the container)

jehlybean commented 4 months ago

Correct. That’s how mine is setup. /updater/data in the container and /mnt/user/appdata/ddns-updater/data is where config is stored.

qdm12 commented 4 months ago

Try running it with LOG_LEVEL=debug and see what logs it has? It should log out the entire configuration read, I guess in this case likely just {}?

jehlybean commented 4 months ago
Running version latest built on 2024-02-08T13:09:44.329Z (commit e676983)

πŸ”§ Need help? https://github.com/qdm12/ddns-updater/discussions/new
πŸ› Bug? https://github.com/qdm12/ddns-updater/issues/new
✨ New feature? https://github.com/qdm12/ddns-updater/issues/new
β˜• Discussion? https://github.com/qdm12/ddns-updater/discussions/new
πŸ’» Email? ***@***.***
πŸ’° Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2024-02-08T17:05:31Z INFO Settings summary:
β”œβ”€β”€ HTTP client
|   └── Timeout: 10s
β”œβ”€β”€ Update
|   β”œβ”€β”€ Period: 5m0s
|   └── Cooldown: 5m0s
β”œβ”€β”€ Public IP fetching
|   β”œβ”€β”€ HTTP enabled: yes
|   β”œβ”€β”€ HTTP IP providers
|   |   └── all
|   β”œβ”€β”€ HTTP IPv4 providers
|   |   └── all
|   β”œβ”€β”€ HTTP IPv6 providers
|   |   └── all
|   β”œβ”€β”€ DNS enabled: yes
|   β”œβ”€β”€ DNS timeout: 3s
|   └── DNS over TLS providers
|       └── all
β”œβ”€β”€ Resolver: use Go default resolver
β”œβ”€β”€ Server
|   β”œβ”€β”€ Listening address: :8000
|   └── Root URL: /
β”œβ”€β”€ Health
|   └── Server listening address: 127.0.0.1:9999
β”œβ”€β”€ Paths
|   └── Data directory: /updater/data
β”œβ”€β”€ Backup: disabled
└── Logger
    β”œβ”€β”€ Level: debug
    └── Caller: hidden
2024-02-08T17:05:31Z INFO reading JSON config from file /updater/data/config.json
2024-02-08T17:05:31Z DEBUG config read: {}
2024-02-08T17:05:31Z WARN Found no setting to update record
2024-02-08T17:05:32Z DEBUG configured to fetch IP: v4 or v6: false, v4: false, v6: false
2024-02-08T17:05:32Z INFO [healthcheck server] listening on 127.0.0.1:9999
2024-02-08T17:05:32Z INFO [backup] disabled
2024-02-08T17:05:32Z DEBUG your public IP address are: v4 or v6: invalid IP, v4: invalid IP, v6: invalid IP
2024-02-08T17:05:32Z INFO [http server] listening on :8000
2024/02/08 17:06:06 "GET http://192.168.1.100:8000/ HTTP/1.1" from 192.168.3.3:64069 - 200 1273B in 17.391Β΅s
2024/02/08 17:06:06 "GET http://192.168.1.100:8000/favicon.ico HTTP/1.1" from 192.168.3.3:64069 - 404 19B in 6.801Β΅s
qdm12 commented 4 months ago

Yes it doesn't find the file /updater/data/config.json.

DEBUG config read: {}

so it creates as an empty json object {}.

Try accessing a terminal on your Unraid machine and run

docker inspect --format "{{json .Mounts}}" $(docker ps --filter "label=org.opencontainers.image.title=ddns-updater" --latest --format "{{.ID}}" --no-trunc)

That should print out the bind mounts