[Pdns-users] API issue

qutic development mailinglists at qutic.com
Sun Jul 26 11:34:05 UTC 2020


> we are using PowerDNS version 4.2.2 and seeing errors creating subdomains via the api.
> 
> The following curl worked for years [1], but after an update to latest pdns version it is returning 500 http errors:
> 
> curl -i -s -XPATCH \
>  -H 'X-API-Key: $powerdns_api_key' \
>  https://$powerdns_host/api/v1/servers/localhost/zones/$domain -d '{
>  "rrsets": [
>    {
>      "name": "$subdomain.$domain.",
>      "type": "A",
>      "changetype": "REPLACE",
>      "ttl": 600,
>      "records": [
>        {
>          "content": "$ip",
>          "disabled": false
>        }
>      ]
>    }
>  ]
> }'
> 
> HTTP ISE for "/api/v1/servers/localhost/zones/example.com": Exception: GSQLBackend unable to insert empty non-terminal rr '_domainkey.example.com' in domain_id 2: Could not execute mysql statement: insert into records (type,domain_id,disabled,name,ordername,auth,content,ttl,prio) values (null,?,0,?,?,?,NULL,NULL,NULL): Column 'type' cannot be null
> 
> Any ideas what´s wrong?

To answer my own question: 

We have a TXT record like 202007._domainkey but had a missing _domainkey record!
After adding it the issue is gone - like the error message is saying it...

Best regards
Stefan


More information about the Pdns-users mailing list