Bug 828687 - Unable to update dns when deleting host
Unable to update dns when deleting host
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
6.3
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rob Crittenden
Namita Soman
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-05 04:05 EDT by Steeve Goveas
Modified: 2015-05-20 11:36 EDT (History)
3 users (show)

See Also:
Fixed In Version: ipa-3.0.0-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 04:15:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steeve Goveas 2012-06-05 04:05:54 EDT
Description of problem:
While deleting host with --updatedns, the deletion fails with error
"ipa: ERROR: PTR record does not contain 'hp-xw4200-01.rhts.eng.bos.redhat.com..'". Notice there are two trailing dots in the error message.


Version-Release number of selected component (if applicable):
ipa-server-2.2.0-16.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Add client A and PTR records in IPA DNS server
2. Add client with "ipa host-add" from the ipa server or ipa-join from the client machine.
3. Try deleting the client with ipa host-del updating dns
# ipa host-del <client host machine> --updatedns
  
Actual results:
Command exit with error message
ipa: ERROR: PTR record does not contain 'hp-xw4200-01.rhts.eng.bos.redhat.com..'

Expected results:
---------------------------------------------------
Deleted host "hp-xw4200-01.rhts.eng.bos.redhat.com" and updated DNS records
---------------------------------------------------

Additional info:

[root@ibm-hs22-05 ~]# ipa host-find
---------------
2 hosts matched
---------------
  Host name: hp-xw4200-01.rhts.eng.bos.redhat.com
  Principal name: host/hp-xw4200-01.rhts.eng.bos.redhat.com@RHTS.ENG.BRQ.REDHAT.COM
  SSH public key fingerprint: A8:BA:43:C4:6D:D9:77:A0:60:18:C8:FF:FF:E3:F4:F2 (ssh-rsa), A4:4D:9C:F9:BA:B1:EA:47:20:A9:77:2A:80:10:49:89 (ssh-dss)
  Password: False
  Keytab: False
  Managed by: hp-xw4200-01.rhts.eng.bos.redhat.com

  Host name: ibm-hs22-05.rhts.eng.brq.redhat.com
  Principal name: host/ibm-hs22-05.rhts.eng.brq.redhat.com@RHTS.ENG.BRQ.REDHAT.COM
  SSH public key fingerprint: 24:25:77:BB:CF:04:F6:CB:99:93:93:D9:88:81:B6:09 (ssh-dss), FA:B1:D8:F4:71:DC:11:3E:91:F9:D7:0B:10:C3:10:37 (ssh-rsa)
  Password: False
  Keytab: True
  Managed by: ibm-hs22-05.rhts.eng.brq.redhat.com
----------------------------
Number of entries returned 2
----------------------------

[root@ibm-hs22-05 ~]# ipa dnsrecord-find rhts.eng.bos.redhat.com. hp-xw4200-01
  Record name: hp-xw4200-01
  A record: 10.16.64.87
----------------------------
Number of entries returned 1
----------------------------

[root@ibm-hs22-05 ~]# ipa dnsrecord-find 64.16.10.in-addr.arpa. 87
  Record name: 87
  PTR record: hp-xw4200-01.rhts.eng.bos.redhat.com.
----------------------------
Number of entries returned 1
----------------------------

[root@ibm-hs22-05 ~]# ipa host-del hp-xw4200-01.rhts.eng.bos.redhat.com --updatedns
ipa: ERROR: PTR record does not contain 'hp-xw4200-01.rhts.eng.bos.redhat.com..'
[root@ibm-hs22-05 ~]# ipa host-find
---------------
2 hosts matched
---------------
  Host name: hp-xw4200-01.rhts.eng.bos.redhat.com
  Principal name: host/hp-xw4200-01.rhts.eng.bos.redhat.com@RHTS.ENG.BRQ.REDHAT.COM
  SSH public key fingerprint: A8:BA:43:C4:6D:D9:77:A0:60:18:C8:FF:FF:E3:F4:F2 (ssh-rsa), A4:4D:9C:F9:BA:B1:EA:47:20:A9:77:2A:80:10:49:89 (ssh-dss)
  Password: False
  Keytab: False
  Managed by: hp-xw4200-01.rhts.eng.bos.redhat.com

  Host name: ibm-hs22-05.rhts.eng.brq.redhat.com
  Principal name: host/ibm-hs22-05.rhts.eng.brq.redhat.com@RHTS.ENG.BRQ.REDHAT.COM
  SSH public key fingerprint: 24:25:77:BB:CF:04:F6:CB:99:93:93:D9:88:81:B6:09 (ssh-dss), FA:B1:D8:F4:71:DC:11:3E:91:F9:D7:0B:10:C3:10:37 (ssh-rsa)
  Password: False
  Keytab: True
  Managed by: ibm-hs22-05.rhts.eng.brq.redhat.com
----------------------------
Number of entries returned 2
----------------------------

[root@ibm-hs22-05 ~]# ipa host-del hp-xw4200-01.rhts.eng.bos.redhat.com
---------------------------------------------------
Deleted host "hp-xw4200-01.rhts.eng.bos.redhat.com"
---------------------------------------------------

[root@ibm-hs22-05 ~]# ipa dnsrecord-find rhts.eng.bos.redhat.com. hp-xw4200-01
  Record name: hp-xw4200-01
  A record: 10.16.64.87
----------------------------
Number of entries returned 1
----------------------------

[root@ibm-hs22-05 ~]# ipa dnsrecord-find 64.16.10.in-addr.arpa. 87
  Record name: 87
  PTR record: hp-xw4200-01.rhts.eng.bos.redhat.com.
----------------------------
Number of entries returned 1
----------------------------

[root@ibm-hs22-05 ~]# ipa host-find
--------------
1 host matched
--------------
  Host name: ibm-hs22-05.rhts.eng.brq.redhat.com
  Principal name: host/ibm-hs22-05.rhts.eng.brq.redhat.com@RHTS.ENG.BRQ.REDHAT.COM
  SSH public key fingerprint: 24:25:77:BB:CF:04:F6:CB:99:93:93:D9:88:81:B6:09 (ssh-dss), FA:B1:D8:F4:71:DC:11:3E:91:F9:D7:0B:10:C3:10:37 (ssh-rsa)
  Password: False
  Keytab: True
  Managed by: ibm-hs22-05.rhts.eng.brq.redhat.com
----------------------------
Number of entries returned 1
----------------------------
Comment 2 Martin Kosek 2012-06-05 04:22:37 EDT
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2809
Comment 4 Martin Kosek 2012-08-07 10:33:30 EDT
I could not reproduce the bug:

# rpm -q ipa-server
ipa-server-2.2.0-16.el6.x86_64

# ipa host-add foo.idm.lab.bos.redhat.com --ip-address 10.16.78.100
---------------------------------------
Added host "foo.idm.lab.bos.redhat.com"
---------------------------------------
  Host name: foo.idm.lab.bos.redhat.com
  Principal name: host/foo.idm.lab.bos.redhat.com@IDM.LAB.BOS.REDHAT.COM
  Password: False
  Keytab: False
  Managed by: foo.idm.lab.bos.redhat.com

# ipa dnsrecord-find idm.lab.bos.redhat.com
  Record name: @
  NS record: vm-060.idm.lab.bos.redhat.com.
...
  Record name: foo
  A record: 10.16.78.100

# ipa dnsrecord-find 78.16.10.in-addr.arpa.
  Record name: 100
  PTR record: foo.idm.lab.bos.redhat.com.

# ipa host-del foo.idm.lab.bos.redhat.com --updatedns
-----------------------------------------
Deleted host "foo.idm.lab.bos.redhat.com"
-----------------------------------------

Steeve, can you please revise provided reproduction steps?
Comment 5 Martin Kosek 2012-08-27 06:34:25 EDT
I managed to finally reproduce this issue. The key is in the name of the zone that the host belongs to. It needs to be in a FQDN  form with a trailing dot:


# ipa dnszone-add example.com. --name-server=`hostname`
Administrator e-mail address [hostmaster.example.com.]: 
  Zone name: example.com.
  Authoritative nameserver: vm-055.idm.lab.bos.redhat.com.
  Administrator e-mail address: hostmaster.example.com.
  SOA serial: 1346063470
  SOA refresh: 3600
  SOA retry: 900
  SOA expire: 1209600
  SOA minimum: 3600
  BIND update policy: grant IDM.LAB.BOS.REDHAT.COM krb5-self * A; grant IDM.LAB.BOS.REDHAT.COM krb5-self
                      * AAAA; grant IDM.LAB.BOS.REDHAT.COM krb5-self * SSHFP;
  Active zone: TRUE
  Dynamic update: FALSE
  Allow query: any;
  Allow transfer: none;

# ipa host-add foo.example.com --ip-address=10.16.78.100
----------------------------
Added host "foo.example.com"
----------------------------
  Host name: foo.example.com
  Principal name: host/foo.example.com@IDM.LAB.BOS.REDHAT.COM
  Password: False
  Keytab: False
  Managed by: foo.example.com

# ipa dnsrecord-find 78.16.10.in-addr.arpa.
  Record name: 100
  PTR record: foo.example.com.
...

# ipa host-del foo.example.com --updatedns
ipa: ERROR: PTR record does not contain 'foo.example.com..'
Comment 7 Jenny Galipeau 2012-09-25 12:02:48 EDT
regression test automated in DNS test suite
Comment 10 Namita Soman 2012-12-17 23:14:41 EST
Verified using:ipa-server-3.0.0-11.el6.x86_64

Test output:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: 828687 Unable to update dns when deleting host
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [23:13:13] ::  Ip address is 10.16.96.83
  Zone name: llnewzone.
  Authoritative nameserver: nightcrawler.testrelm.com.
  Administrator e-mail address: ipaqar.redhat.com.
  SOA serial: 2010010701
  SOA refresh: 303
  SOA retry: 101
  SOA expire: 1202
  SOA minimum: 33
  SOA time to live: 55
  BIND update policy: grant TESTRELM.COM krb5-self * A; grant TESTRELM.COM krb5-self * AAAA; grant TESTRELM.COM krb5-self * SSHFP;
  Active zone: TRUE
  Dynamic update: FALSE
  Allow query: any;
  Allow transfer: none;
:: [   PASS   ] :: Adding a new zone to test with
-------------------------
Added host "tt.llnewzone"
-------------------------
  Host name: tt.llnewzone
  Principal name: host/tt.llnewzone@TESTRELM.COM
  Password: False
  Keytab: False
  Managed by: tt.llnewzone
:: [   PASS   ] :: Add a new host to test with
  PTR record: tt.llnewzone.
:: [   PASS   ] :: Make sure PTR record was added for the new host.
---------------------------
Deleted host "tt.llnewzone"
---------------------------
:: [   PASS   ] :: Try to delete the new host. This should pass
ipa: ERROR: 252: DNS resource record not found
ipa: ERROR: tt.llnewzone: host not found
Comment 12 errata-xmlrpc 2013-02-21 04:15:05 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0528.html

Note You need to log in before you can comment on or make changes to this bug.