libdns / digitalocean

MIT License
10 stars 15 forks source link

Error when using digitalocean provider as a dynamicdns service. #10

Open eddiezab opened 10 months ago

eddiezab commented 10 months ago

Using the below configuration, I get the error in the log excerpt that follows. It seems somewhere in the flow, the record ID is not getting set and thus the strconv.Atoi error. In the end no records are created. Using the same provider to obtain the certificate for tls, the proper records are created, and the cert is obtained successfully.

Any help would be appreciated.

Thanks, -- Ed

{
debug

    dynamic_dns {

                provider digitalocean <api_key> 

        ip_source simple_http https://icanhazip.com
        versions ipv4

        domains {
            example.com @ www
        }

    }
}

example.com {  
    tls internal

    import proxy_upstream
}
2023/11/09 17:14:52.606 DEBUG   dynamic_dns     beginning IP address check
2023/11/09 17:14:52.613 INFO    pki.ca.local    root certificate is already trusted by system   {"path": "storage:pki/authorities/local/root.crt"}
2023/11/09 17:14:52.613 INFO    http    enabling HTTP/3 listener        {"addr": ":443"}
2023/11/09 17:14:52.613 INFO    tls     cleaning storage unit   {"description": "FileStorage:/root/.local/share/caddy"}
2023/11/09 17:14:52.613 DEBUG   http    starting server loop    {"address": "[::]:443", "tls": true, "http3": true}
2023/11/09 17:14:52.613 INFO    http.log        server running  {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/11/09 17:14:52.613 DEBUG   http    starting server loop    {"address": "[::]:80", "tls": false, "http3": false}
2023/11/09 17:14:52.613 INFO    http.log        server running  {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2023/11/09 17:14:52.613 INFO    http    enabling automatic TLS certificate management   {"domains": ["example.com"]}
2023/11/09 17:14:52.613 INFO    tls     finished cleaning storage units
2023/11/09 17:14:52.613 WARN    tls     stapling OCSP   {"error": "no OCSP stapling for [example.com]: no OCSP server specified in certificate", "identifiers": ["example.com"]}
2023/11/09 17:14:52.613 DEBUG   tls.cache       added certificate to cache      {"subjects": ["example.com"], "expiration": "2023/11/10 04:32:18.000", "managed": true, "issuer_key": "local", "hash": "288de7c42a45ffd59cc0d28623a9fd8a4e0282335bb95cfefa10848edc0483c0", "cache_size": 1, "cache_capacity": 10000}
2023/11/09 17:14:52.613 DEBUG   events  event   {"name": "cached_managed_cert", "id": "76f34dc5-098d-40d3-bf85-d7cf93cce0c2", "origin": "tls", "data": {"sans":["example.com"]}}
2023/11/09 17:14:52.614 INFO    autosaved config (load with --resume flag)      {"file": "/root/.config/caddy/autosave.json"}
2023/11/09 17:14:52.614 INFO    serving initial configuration
2023/11/09 17:14:53.046 DEBUG   dynamic_dns     found DNS record        {"type": "A", "name": "lighthouse.example.com.", "zone": "example.com", "value": "127.0.0.1"}
2023/11/09 17:14:53.046 DEBUG   dynamic_dns     found DNS record        {"type": "A", "name": "@.example.com.", "zone": "example.com", "value": "127.0.0.1"}
2023/11/09 17:14:53.047 INFO    dynamic_dns     domain not found in DNS {"domain": "example.com"}
2023/11/09 17:14:53.047 INFO    dynamic_dns     domain not found in DNS {"domain": "example.com"}
2023/11/09 17:14:53.047 INFO    dynamic_dns     domain not found in DNS {"domain": "www.example.com"}
2023/11/09 17:14:53.047 INFO    dynamic_dns     domain not found in DNS {"domain": "www.example.com"}
2023/11/09 17:14:53.047 DEBUG   dynamic_dns     looked up current IPs from DNS  {"lastIPs": {"example.com":{"A":[""],"AAAA":[""]},"www.example.com":{"A":[""],"AAAA":[""]}}}
2023/11/09 17:14:53.382 DEBUG   dynamic_dns.ip_sources.simple_http      lookup  {"type": "IPv4", "endpoint": "https://icanhazip.com", "ip": "127.0.0.1"}
2023/11/09 17:14:53.382 INFO    dynamic_dns     updating DNS record     {"zone": "example.com", "type": "A", "name": "@", "value": "127.0.0.1", "ttl": 0}
2023/11/09 17:14:53.382 INFO    dynamic_dns     updating DNS record     {"zone": "example.com", "type": "A", "name": "www", "value": "127.0.0.1", "ttl": 0}
2023/11/09 17:14:53.382 ERROR   dynamic_dns     failed setting DNS record(s) with new IP address(es)    {"zone": "example.com", "error": "strconv.Atoi: parsing \"\": invalid syntax"}
2023/11/09 17:14:53.382 INFO    dynamic_dns     finished updating DNS   {"current_ips": ["127.0.0.1"]}