Bug: program writes empty IPs to updates.json - validation error- IP empty #321

Closed
opened 2025-11-20 04:22:42 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @ncovercash on GitHub (Oct 16, 2023).

In the event of network failures (IP hosts unavailable, misconfigured network, IPv6 broken, etc.), the updates.json can get store empty IP addresses; when read back, the application terminates. IMO this should be warned but the invalid record ignored, rather than causing the entire thing to exit.

  1. Is this urgent: No

  2. DNS provider(s) you use: HE.net (not applicable to bug)

  3. Program version:

    Running version latest built on 2023-10-14T09:56:50.040Z (commit e635b19)

  4. What are you using to run the container: docker-compose

  5. Extra information (optional)

Logs:

# Network issue which caused erronous saved data
ddns-updater  | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 1 of 3: dial tcp6 [2606:4700:4700::1111]:853: connect: cannot assign requested address
ddns-updater  | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 2 of 3: Get "https://api6.ipify.org": dial tcp [2607:f2d8:2010:2::3]:443: connect: cannot assign requested address
ddns-updater  | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 3 of 3: dial tcp6 [2620:119:35::35]:853: connect: cannot assign requested address
ddns-updater  | 2023-10-16T21:57:49Z ERROR dial tcp6 [2620:119:35::35]:853: connect: cannot assign requested address

# When loading the update file
ddns-updater  | 2023-10-16T21:57:34Z ERROR /updater/data/updates.json validation error: IP is empty: IP 1 of 2 for record {"domain":"example.com","host":"@","ips":[{"ip":"","time":"2023-10-16T21:57:03.257793512Z"},{"ip":"1.2.3.4","time":"2023-10-16T21:57:03.259875041Z"}]}

Update file:

{
  "records": [
    {
      "domain": "example.com",
      "host": "@",
      "ips": [
        {
          "ip": "",
          "time": "2023-10-16T21:52:24.06802899Z"
        },
        {
          "ip": "1.2.3.4",
          "time": "2023-10-16T21:52:24.077491571Z"
        }
      ]
    }
  ]
}

Host OS:
Debian bullseye

Originally created by @ncovercash on GitHub (Oct 16, 2023). In the event of network failures (IP hosts unavailable, misconfigured network, IPv6 broken, etc.), the `updates.json` can get store empty IP addresses; when read back, the application terminates. IMO this should be warned but the invalid record ignored, rather than causing the entire thing to exit. 1. Is this urgent: No 2. DNS provider(s) you use: HE.net (not applicable to bug) 3. Program version: <!-- See the line at the top of your logs --> `Running version latest built on 2023-10-14T09:56:50.040Z (commit e635b19)` 4. What are you using to run the container: docker-compose 5. Extra information (optional) Logs: ```log # Network issue which caused erronous saved data ddns-updater | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 1 of 3: dial tcp6 [2606:4700:4700::1111]:853: connect: cannot assign requested address ddns-updater | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 2 of 3: Get "https://api6.ipify.org": dial tcp [2607:f2d8:2010:2::3]:443: connect: cannot assign requested address ddns-updater | 2023-10-16T21:57:49Z WARN obtaining ipv6 address: try 3 of 3: dial tcp6 [2620:119:35::35]:853: connect: cannot assign requested address ddns-updater | 2023-10-16T21:57:49Z ERROR dial tcp6 [2620:119:35::35]:853: connect: cannot assign requested address # When loading the update file ddns-updater | 2023-10-16T21:57:34Z ERROR /updater/data/updates.json validation error: IP is empty: IP 1 of 2 for record {"domain":"example.com","host":"@","ips":[{"ip":"","time":"2023-10-16T21:57:03.257793512Z"},{"ip":"1.2.3.4","time":"2023-10-16T21:57:03.259875041Z"}]} ``` Update file: ```json { "records": [ { "domain": "example.com", "host": "@", "ips": [ { "ip": "", "time": "2023-10-16T21:52:24.06802899Z" }, { "ip": "1.2.3.4", "time": "2023-10-16T21:52:24.077491571Z" } ] } ] } ``` Host OS: Debian bullseye
saavagebueno added the Category: Database 🗃️Priority: 🚨 Urgent labels 2025-11-20 04:22:42 -05:00
Author
Owner

@NeoMod commented on GitHub (Oct 30, 2023):

I agree. I encountered this error just now after a drive failure brought down my pihole which in turn left my network inoperable, and I spent a good ten minutes figuring it out.

It should show a warning and then update the IP with the current one, overwriting/correcting the info on file. Or, as suggested above, it should use a dummy value to populate the field and then proceed with the update. (maybe we can use a value previously declared in a label just for this very purpose?)

EDIT: @ncovercash would you please consider editing the post to include the error in the title? (not the whole string, maybe just the "validation error- IP empty" string) It could help others in search of the same error.

@NeoMod commented on GitHub (Oct 30, 2023): I agree. I encountered this error just now after a drive failure brought down my pihole which in turn left my network inoperable, and I spent a good ten minutes figuring it out. It should show a _warning_ and then update the IP with the current one, overwriting/correcting the info on file. Or, as suggested above, it should use a dummy value to populate the field and then proceed with the update. (maybe we can use a value previously declared in a label just for this very purpose?) EDIT: @ncovercash would you please consider editing the post to include the error in the title? (not the whole string, maybe just the "validation error- IP empty" string) It could help others in search of the same error.
Author
Owner

@qdm12 commented on GitHub (Jan 18, 2024):

Hello there, thanks for reporting this! And sorry for the mega delay.
I'll look into this more in the coming hours/days.
My take on this is the updates.json file should never have an empty or invalid IP written to it, and we should keep the check in place. I'll check my code, there must be something wrong allowing invalid IPs to be written to that file.

@qdm12 commented on GitHub (Jan 18, 2024): Hello there, thanks for reporting this! And sorry for the mega delay. I'll look into this more in the coming hours/days. My take on this is the updates.json file should never have an empty or invalid IP written to it, and we should keep the check in place. I'll check my code, there must be something wrong allowing invalid IPs to be written to that file.
Author
Owner

@qdm12 commented on GitHub (Jan 24, 2024):

Fixed in 7f0e858fa0
Duplicate of #280

@qdm12 commented on GitHub (Jan 24, 2024): Fixed in 7f0e858fa01ea181fe8898f3fb99631a06ed8ea3 Duplicate of #280
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#321