Returning a {"result":false} was one of the things I did test. But that response does not make sense. A false response suggests the backend failed to process the query successfully. In this case, the query is processed successfully, but there is just no response data to provide. i.e. the domain requested does not exist. So issuing a false as a result does not make sense to me.
The documentation on the query says *"Retrieves information about given domain from the backend. If your return value has no zone attribute, the backend will signal error. Everything else will default to something. Default values: serial:0, kind:NATIVE, id:-1, notified_serial:-1, last_check:0, masters: []. Masters, if present, must be array of strings."* Which suggests the response must at minimum have the zone attribute i.e. {"result": { "zone": ???? }}, I've tried this with the following zone values "", null, {} but all fail. I've set loglevel=9 but despite this level supposedly being verbose, there is very little produced. Here is all the logs from startup to execution of the /domain/add api call Jan 25 00:38:34 Listening on controlsocket in '/var/run/pdns.controlsocket' Jan 25 00:38:34 Guardian is launching an instance Jan 25 00:38:34 Reading random entropy from '/dev/urandom' Jan 25 00:38:34 Loading '/usr/lib/x86_64-linux-gnu/pdns/libremotebackend.so' Jan 25 00:38:34 [RemoteBackend] This is the remote backend version 4.1.6 reporting Jan 25 00:38:34 This is a guarded instance of pdns Jan 25 00:38:34 UDP server bound to 0.0.0.0:53 Jan 25 00:38:34 UDPv6 server bound to [::]:53 Jan 25 00:38:34 TCP server bound to 0.0.0.0:53 Jan 25 00:38:34 TCPv6 server bound to [::]:53 Jan 25 00:38:34 PowerDNS Authoritative Server 4.1.6 (C) 2001-2018 PowerDNS.COM BV Jan 25 00:38:34 Using 64-bits mode. Built using gcc 8.3.0. Jan 25 00:38:34 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2. Jan 25 00:38:34 Listening for HTTP requests on 0.0.0.0:8081 Jan 25 00:38:34 Doing stub resolving, using resolvers: 172.18.112.1, 192.168.1.1 Jan 25 00:38:34 Question got answered by 192.168.1.1 Jan 25 00:38:34 Could not retrieve security status update for '4.1.6-3.Debian' on 'auth-4.1.6-3.Debian.security-status.secpoll.powerdns.com.', RCODE = Non-Existent domain Jan 25 00:38:34 Creating backend connection for TCP Jan 25 00:38:34 About to create 3 backend threads for UDP Jan 25 00:38:35 Done launching threads, ready to distribute questions Jan 25 00:38:56 HTTP: Handling request "/api/v1/servers/localhost/zones" Jan 25 00:38:56 Reconnecting to backend Jan 25 00:38:57 closing socket connection Jan 25 00:38:57 HTTP: Result for "/api/v1/servers/localhost/zones": 200, body length: 2 Jan 25 00:38:57 HTTP: Handling request "/api/v1/servers/localhost/statistics" Jan 25 00:38:57 HTTP: Result for "/api/v1/servers/localhost/statistics": 200, body length: 3954 Jan 25 00:39:50 HTTP: Handling request "/api/v1/servers/localhost/zones" Jan 25 00:39:50 Reconnecting to backend Jan 25 00:39:50 closing socket connection Jan 25 00:39:50 HTTP: Result for "/api/v1/servers/localhost/zones": 422, body length: 46 Any other suggestions ? Thanks On Sat, Jan 25, 2020 at 2:12 AM Aki Tuomi <cmo...@cmouse.fi> wrote: > On Sat, Jan 25, 2020 at 12:38:26AM +0930, Austin Brandis wrote: > > Hi, > > > > Please let me know if I'm not on the right mailing list. > > I've searched all the github issues, and elsewhere but have not found > > anything helpful. > > > > Currently developing a remote backend, but am having some trouble with > the > > getDomainInfo call. > > > > I'm making a POST request to the web API to /domain/add > > > > Here is where I get lost... > > My backend receives a getDomainInfo query after an Initialize. > > Whilst I found this initially odd, I figured that maybe PDNS was > confirming > > the presence of any domain first, and then an "set" query would be issued > > later. > > Though the documentation for remote backend ( > > https://doc.powerdns.com/authoritative/backends/remote.html) also does > not > > indicate which "query" does the adding. > > I figured I'd just work it out when the relevant JSON arrives. > > > > My backend receives a getDomainInfo JSON as such > > < > https://doc.powerdns.com/authoritative/backends/remote.html#getdomaininfo> > > e.g. {"method":"getdomaininfo","parameters":{"name":"foo.com"}} > > > > when foo.com does not exit it is unclear in the documentation what the > > backend should return. > > No matter what I try the HTTP response from the WEB API after the POST is > > always 400, and PDNS closes the socket to my backend. > > All suggesting PDNS remote is not happy with the JSON response to the > > getDomainInfo query > > > > I have tried > > {"result":{}} > > {"result":""} > > {"result":null} > > {"result":false} > > {"result":"zone":{}} > > {"result":"zone":""} > > {"result":"zone":null} > > responses, but none work. > > > > What am I doing wrong ? > > I assume domain additions are implemented in remote backend ? > > > > Thanks > > Austin > > Hi! > > "You must always reply with JSON hash with at least one key, ‘result’. > This must be boolean false if the query failed." > > If this does not work though, it could be a bug. Is there anything in logs? > > Aki >
_______________________________________________ Pdns-dev mailing list Pdns-dev@mailman.powerdns.com https://mailman.powerdns.com/mailman/listinfo/pdns-dev