ddns-updater icon indicating copy to clipboard operation
ddns-updater copied to clipboard

Bug: Error while using Linode DNS Update

Open DevSkoll opened this issue 1 year ago • 4 comments

TLDR: Failure (cannot create record: bad HTTP status: 400: {[{name Name contains invalid characters} {name Invalid hostname}]}),

  1. Is this urgent: \No
  2. DNS provider(s) you use: Linoide
  3. Program version: 2.4.1 (from unRAID)
  4. What are you using to run the container: docker / unRAID
  5. Extra information (optional): There was also an issue with finding an updates.json when setting up the container. I just copied the config.json as updates.json which fixed this error.

Logs:

💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2022/06/29 22:00:29 INFO reading JSON config from file /updater/data/config.json
2022/06/29 22:00:29 INFO Found single setting to update record
2022/06/29 22:00:29 INFO Reading history from database: domain arctek.us host @
2022/06/29 22:00:29 INFO healthcheck server: listening on 127.0.0.1:9999
2022/06/29 22:00:29 INFO backup: disabled
2022/06/29 22:00:29 INFO http server: listening on :8000
2022/06/29 22:00:33 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1588B in 90.818µs
2022/06/29 22:00:37 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1588B in 65.563µs
2022/06/29 22:00:54 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1588B in 59.949µs
2022/06/29 22:01:00 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1588B in 55.264µs
2022/06/29 22:01:05 WARN cannot DNS resolve arctek.us after 5 tries: lookup arctek.us on 192.168.50.1:53: read udp 172.17.0.4:49428->192.168.50.1:53: i/o timeout
2022/06/29 22:01:05 INFO IPv4 address of arctek.us is <nil> and your IPv4 address is 66.58.202.192
2022/06/29 22:01:05 INFO Updating record [domain: arctek.us | host: @ | provider: linode | ip: ipv4] to use 66.58.202.192
2022/06/29 22:01:05 ERROR cannot create record: bad HTTP status: 400: {[{name Name contains invalid characters} {name Invalid hostname}]}
2022/06/29 22:01:13 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1678B in 60.195µs
2022/06/29 22:03:41 "GET http://192.168.50.10:8000/ HTTP/1.1" from 192.168.50.223:59567 - 200 1681B in 57.676µs
2022/06/29 22:05:59 WARN cannot DNS resolve arctek.us after 5 tries: lookup arctek.us on 192.168.50.1:53: server misbehaving
2022/06/29 22:05:59 INFO IPv4 address of arctek.us is <nil> and your IPv4 address is 66.58.202.192
2022/06/29 22:05:59 INFO Updating record [domain: arctek.us | host: @ | provider: linode | ip: ipv4] to use 66.58.202.192
2022/06/29 22:06:00 ERROR cannot create record: bad HTTP status: 400: {[{name Name contains invalid characters} {name Invalid hostname}]}

Configuration file (remove your credentials!):

{
    "settings": [
      {
        "provider": "linode",
        "domain": "arc***.us",
        "host": "@",
        "token": "xxxxxxxxxxxxxxxxxxx",
        "ip_version": "ipv4"
      }
    ]
  }

Host OS: unRAID

DevSkoll avatar Jun 30 '22 06:06 DevSkoll

Update: This is just an issue when I use the @ record. Might need to find a way to target it without it throwing an error. It worked just fine with a host that had a time.

DevSkoll avatar Jun 30 '22 06:06 DevSkoll

Fixed by resetting the updates.json file. Will throw an error on launch if there are hostnames without input.

DevSkoll avatar Jul 01 '22 21:07 DevSkoll

Sorry I didn't get how you fixed it. Can you clarify what was wrong with updates.json so i can fix it for good? Thanks!

qdm12 avatar Jul 02 '22 14:07 qdm12

Haha, my bad.

So my configuration is as follows (Modified with domain.com):

    "settings": [
      {
        "provider": "linode",
        "domain": "domain.com",
        "host": "",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "ip_version": "ipv4"
      },
      {
        "provider": "linode",
        "domain": "domain.com",
        "host": "admin",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "ip_version": "ipv4"
      }
    ]
}

Doing this starts populating the updates.json with (Modified with domain.com):

{
  "records": [
    {
      "domain": "domain.com",
      "host": "",
      "ips": [
        {
          "ip": "1.1.1.1",
          "time": "2022-07-01T16:28:53.972952902-08:00"
        }
      ]
    },
    {
      "domain": "domain.com",
      "host": "admin",
      "ips": [
        {
          "ip": "1.1.1.1",
          "time": "2022-07-01T16:28:53.972952902-08:00"
        }
      ]
    }
 ]
}

If I stop the service and then start it again with the object as "host": "", it creates an error in the console where it won't start.

The fix I found that works are to delete the data in updates.json every time before I launch the service again. Where it can regenerate it with current info. It will create these entries, but it will not restart and run if that info is already there.

Sorry if this is a bad explanation.

DevSkoll avatar Jul 02 '22 23:07 DevSkoll

I changed it in f09ca2dd0ae2f8ebc8ecea72a084fe0d9156dbda to set the name field to the actual full domain name instead of just the host. So now instead of @ it would be domain.com. As documented https://www.linode.com/docs/api/domains/#domain-record-create

A and AAAA: The hostname or FQDN of the Record.

Closing this assuming this would fix, but let me know if the problem is still there 😉

qdm12 avatar Sep 04 '22 03:09 qdm12