pdns icon indicating copy to clipboard operation
pdns copied to clipboard

Updating account via API not working

Open ArnoSen opened this issue 4 years ago • 6 comments

  • Program: Authoritative
  • Issue type: Bug report

Short description

When updating the account following https://doc.powerdns.com/authoritative/http-api/zone.html#put--servers-server_id-zones-zone_id, the server returns a 204 but the new account does not 'stick'. This was working for a few years at least, but it looks like to be broken now.

Environment

  • Operating system: CentOS
  • Software version: PowerDNS Authoritative Server 4.2.3 (C) 2001-2019 PowerDNS.COM BV Using 64-bits mode. Built using gcc 4.8.5 20150623 (Red Hat 4.8.5-39) on Sep 22 2020 13:58:59 by root@776a317fd72f.
  • Software source: packages from repo.powerdns.com

Steps to reproduce

  1. Create a zone with or without an account value set
  2. Execute a HTTP PUT against the zone with a new account. The payload is the full zone.

For example: URL: http://testserver:8081/api/v1/servers/localhost/zones/arnotest.com., method: PUT Payload: {"id":"arnotest.com.","url":"/api/v1/servers/localhost/zones/arnotest.com.","name":"arnotest.com.","kind":"Native","account":"newaccount","nsec3narrow":false,"nsec3param":"","serial":2021070701,"rrsets":[{"name":"web.arnotest.com.","type":"A","ttl":3600,"records":[{"content":"20.8.10.13","disabled":false}]},{"name":"arnotest.com.","type":"SOA","ttl":3600,"records":[{"content":"testserver. hostmaster.arnotest.com. 2021070701 10800 3600 604800 3600","disabled":false}]},{"name":"arnotest.com.","type":"NS","ttl":3600,"records":[{"content":"ns1.test.nl.","disabled":false},{"content":"ns2.test.nl.","disabled":false}]},{"name":"arnotest.com.","type":"A","ttl":0,"records":[{"content":"127.0.0.5","disabled":false}]}]}

Expected behaviour

The account should be updated

Actual behaviour

Server returns 204 and empty but the account is not updated.

Other information

I tried with the most simple payload but it did not update the account either.

||| URL: http://dc2-pdns-t01.sentia.net:8081/api/v1/servers/localhost/zones/arnotest.com., method: PUT ||| Payload: {"account":"arnotest"}

ArnoSen avatar Aug 25 '21 09:08 ArnoSen

Formatted payload:

{
  "id": "arnotest.com.",
  "url": "/api/v1/servers/localhost/zones/arnotest.com.",
  "name": "arnotest.com.",
  "kind": "Native",
  "account": "newaccount",
  "nsec3narrow": false,
  "nsec3param": "",
  "serial": 2021070701,
  "rrsets": [
    {
      "name": "web.arnotest.com.",
      "type": "A",
      "ttl": 3600,
      "records": [
        {
          "content": "20.8.10.13",
          "disabled": false
        }
      ]
    },
    {
      "name": "arnotest.com.",
      "type": "SOA",
      "ttl": 3600,
      "records": [
        {
          "content": "testserver. hostmaster.arnotest.com. 2021070701 10800 3600 604800 3600",
          "disabled": false
        }
      ]
    },
    {
      "name": "arnotest.com.",
      "type": "NS",
      "ttl": 3600,
      "records": [
        {
          "content": "ns1.test.nl.",
          "disabled": false
        },
        {
          "content": "ns2.test.nl.",
          "disabled": false
        }
      ]
    },
    {
      "name": "arnotest.com.",
      "type": "A",
      "ttl": 0,
      "records": [
        {
          "content": "127.0.0.5",
          "disabled": false
        }
      ]
    }
  ]
}

Habbie avatar Aug 25 '21 11:08 Habbie

4.2.3 is End Of Life, can you please try 4.5.1?

Habbie avatar Aug 25 '21 11:08 Habbie

Also: which backend is used, and which version previously worked?

zeha avatar Sep 27 '21 06:09 zeha

We recently upgraded our test environment to 4.3.3. The issue is also present in this version. Since this version is only receiving critical updates, we will test a newer release and let you know the findings. The backend is mysql.

I am trying to find in what version it was still working.

ArnoSen avatar Mar 30 '22 12:03 ArnoSen

We tried 4.7.0-0.alpha1 and the issue is still there.

ArnoSen avatar Mar 30 '22 12:03 ArnoSen

It is likely that in version pdns-4.2.1-1 the update still worked. I cannot tell with 100% certainty because the issue was reported by an user and I do not know how long the issue was already there.

ArnoSen avatar Mar 30 '22 12:03 ArnoSen