Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Bad Data:" when autocreate_reverse_records = 1 and reverse domain does not exist #197

Open
XANi opened this issue Feb 14, 2023 · 1 comment

Comments

@XANi
Copy link

XANi commented Feb 14, 2023

Problem: If that option is enabled and zone doesn't exist, previous version(sry don't remember which combination of opera DNS and PowerDNS worked) just sent warning about reverse not existing (which is fine, we don't own reverse for all records we need to set), new version doesn't allow to change

version 0.2.7

image

response from PowerDNS:

curl -H"X-API-Key: xyz" http://127.0.1.3:8001/api/v1/servers/localhost/zones/in-addr.arpa. -I
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Connection: close
Content-Type: text/plain; charset=utf-8
Server: PowerDNS/4.4.1

https://doc.powerdns.com/authoritative/http-api/zone.html

The response in JSON from ODNS isn't very helpful either:

HTTP/1.1 400 Bad request
Server: nginx/1.18.0
Date: Tue, 14 Feb 2023 13:14:27 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive

8d
{
    "errors": [
        {
            "userMessage": "Bad data",
            "internalMessage": "",
            "code": 2
        }
    ]
}
0

stack trace:

2023/02/14 10:08:58 [error] 545#545: *3453 FastCGI sent in stderr: "
PHP message: 1676365738: BadData in /var/www/html/dns-ui-0.2.7/model/zone.php:727
PHP message: 1676365738: Stack trace:
PHP message: 1676365738: #0 /var/www/html/dns-ui-0.2.7/views/api.php(147): Zone->process_bulk_json_rrset_update()
PHP message: 1676365738: #1 /var/www/html/dns-ui-0.2.7/views/api.php(63): API->update_zone_rrsets()
PHP message: 1676365738: #2 /var/www/html/dns-ui-0.2.7/views/api.php(106): API->options()
PHP message: 1676365738: #3 /var/www/html/dns-ui-0.2.7/views/api.php(33): API->zone()
PHP message: 1676365738: #4 /var/www/html/dns-ui-0.2.7/requesthandler.php(62): require('/var/www/html/d...')
PHP message: 1676365738: #5 /var/www/html/dns-ui-0.2.3/public_html/init.php(18): require('/var/www/html/d...')
PHP message: 1676365738: #6 {main}" while reading response header from upstream, client: 127.0.0.1, server: _, request: "PATCH /api/v2/zones/example.com. HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "www.hq-core-dnsmaster.non.3dart.com", referrer: "https://www.example.com.com/zones/example.com?name=tt"
@Napsty
Copy link

Napsty commented Mar 1, 2023

Can confirm.

[Wed Mar 01 15:24:36.460499 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: BadData in /var/dns-ui/model/zone.php:679, referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460530 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: Stack trace:, referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460536 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #0 /var/dns-ui/views/api.php(147): Zone->process_bulk_json_rrset_update(Object(stdClass)), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460670 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #1 /var/dns-ui/views/api.php(63): API->update_zone_rrsets('example.com.'), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460829 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #2 /var/dns-ui/views/api.php(106): API->options(Array, Array), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460897 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #3 /var/dns-ui/views/api.php(33): API->zone('example.com.'), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460923 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #4 /var/dns-ui/requesthandler.php(62): require('/var/dns-ui/vie...'), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460974 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #5 /var/dns-ui/public_html/init.php(18): require('/var/dns-ui/req...'), referer: http://dnsmgmt-test.example.com/zones/example.com
[Wed Mar 01 15:24:36.460998 2023] [php7:notice] [pid 25251] [client 10.162.210.49:58281] 1677680676: #6 {main}, referer: http://dnsmgmt-test.example.com/zones/example.com

Works when the PTR Zone is created in PowerDNS.
Other workaround is probably to disable the auto-creation of PTR records by setting autocreate_reverse_records = 0 in config.ini, as @XANi mentioned, but haven't tested this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants