Bug 12018 - samba-tool domain demote fails on DNS objects without dnsRecord attribute
Summary: samba-tool domain demote fails on DNS objects without dnsRecord attribute
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: 4.4.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-11 13:32 UTC by Björn Baumbach
Modified: 2016-11-17 18:22 UTC (History)
3 users (show)

See Also:


Attachments
fix for 4.4 cherry-picked from master (3.57 KB, patch)
2016-07-19 10:53 UTC, Björn Baumbach
metze: review+
abartlet: review+
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Baumbach 2016-07-11 13:32:48 UTC
Running the command
samba-tool domain demote --remove-other-dead-server=
fails if there are dnsNode object without an dnsRecord attribute.


ERROR(<type 'exceptions.TypeError'>): uncaught exception - __ndr_unpack__() argument 1 must be string or read-only buffer, not dnsp.DnssrvRpcRecord
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/samba/netcmd/domain.py", line 720, in run
    remove_dc.remove_dc(samdb, logger, remove_other_dead_server)
  File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 423, in remove_dc
    remove_dns_account=True)
  File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 351, in offline_remove_ntds_dc
    remove_dns_account=remove_dns_account)
  File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 266, in offline_remove_server
    remove_dns_references(samdb, logger, dnsHostName)
  File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 186, in remove_dns_references
    for v in values if not to_remove(v) ]
  File "/usr/lib64/python2.6/site-packages/samba/remove_dc.py", line 160, in to_remove
    dnsRecord = ndr_unpack(dnsp.DnssrvRpcRecord, value)
  File "/usr/lib64/python2.6/site-packages/samba/ndr.py", line 45, in ndr_unpack
    object.__ndr_unpack__(data, allow_remaining=allow_remaining)
A transaction is still active in ldb context [0xe1f320] on tdb:///var/lib/samba/private/sam.ldb
Comment 1 Björn Baumbach 2016-07-19 10:53:52 UTC
Created attachment 12275 [details]
fix for 4.4 cherry-picked from master
Comment 2 Stefan Metzmacher 2016-07-19 11:07:54 UTC
Andrew, please also add your review and assign to Karolin
Comment 3 Ralph Böhme 2016-07-26 10:33:05 UTC
Reassigned to Karolin for inclusion in 4.4.
Comment 4 Karolin Seeger 2016-08-02 07:32:41 UTC
(In reply to Ralph Böhme from comment #3)
Pushed to autobuild-v4-4-test.
Comment 5 Karolin Seeger 2016-08-05 07:40:41 UTC
(In reply to Karolin Seeger from comment #4)
Pushed to v4-4-test.
Closing out bug report.

Thanks!
Comment 6 Andrew Bartlett 2016-11-17 18:22:09 UTC
Fixed in Samba 4.4.6 with 2a71f2e42d74a459346a06eb68a71efa2b7bfad0 from the master commit f8181360a89ac9e53cc991e966958e496271fa15