Univention Bugzilla – Bug 44710
KeyError: 'pTRRecord'
Last modified: 2020-08-19 16:18:18 CEST
Version: 4.1-4 errata406 (Vahr) Remark: Ich wollte die IP eines Hosts ändern Die Ausführung des Kommandos udm/put computers/computer ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.7%/notifier/threads.py", line 82, in _run tmp = self._function() File "%PY2.7%/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 405, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 141, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 445, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 317, in modify return self._modify(modify_childs, ignore_license=ignore_license) File "%PY2.7%/univention/admin/handlers/__init__.py", line 815, in _modify self._ldap_post_modify() File "%PY2.7%/univention/admin/handlers/computers/ipmanagedclient.py", line 270, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2014, in _ldap_post_modify self.__remove_dns_reverse_object(self['name'], None, entry) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1568, in __remove_dns_reverse_object modify(rdn, zone) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1541, in modify if len(attributes['pTRRecord']) == 1: KeyError: 'pTRRecord'
Reported again: Version: 4.2-3 errata312 (Lesum) Remark: habe versucht, einem Host händisch eine neue IP-Adresse zu geben
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Reported again from a customer with UCS Version: 4.4-4-652. It was updated from errata 528 -> 652 After that the error occurs. Seems to be the same to me. Interner Server-Fehler in "udm/put (computers/computer)". Request: udm/put (computers/computer) File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 80, in _run result = self._function() File "/usr/lib/python2.7/dist-packages/notifier/__init__.py", line 104, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/udm/__init__.py", line 440, in _thread module.modify(properties) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/udm/udm_ldap.py", line 645, in modify obj.modify() File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 650, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 1331, in _modify self._ldap_post_modify() File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/computers/__base.py", line 207, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 2722, in _ldap_post_modify self.__remove_dns_reverse_object(self['name'], None, entry) File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 2275, in __remove_dns_reverse_object modify(rdn, zone) File "/usr/lib/python2.7/dist-packages/univention/admin/handlers/__init__.py", line 2248, in modify if len(attributes['pTRRecord']) == 1: KeyError: 'pTRRecord' Testcase: Changing the IP of a device from 10.0.161.15 -> 10.0.161.150 -The Forward DNS entries are changed without errors -For the Reverse DNS records there is no record for the .15 but for the .150 there are three records with all our DNS domains If we change the IP back (.150 -> .15) -The Forward DNS entries are changed without errors -The exception occurs -The value is changed in the UI when I close the exception -There are 3 new PTR records for the .15 with all our DNS domains -The empty PTR record for the .150 remains → is this empty remaining record the cause why the exception occurs?
*** Bug 51736 has been marked as a duplicate of this bug. ***
Created attachment 10460 [details] patch In UDM we have required=True for the ptr_record property of dns/ptr_record. In LDAP the attribute is not required. So we have a dns/ptr_record without ptr_record leading to this exception when trying to remove ptr record entries from it (e.g. when changing the computer's IP address). So why do we have no ptr_record at the object? management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py: 2659 » » for entry in self.__changes['dnsEntryZoneReverse']['remove']: 2667 » » » » self.__remove_dns_reverse_object(self['name'], dn, ip) … 2700 » » for entry in self.__changes['ip']['remove']: 2722 » » » self.__remove_dns_reverse_object(self['name'], None, entry) → because we are iterating over all DNS reverse pointers and remove them from the object. Without considering to remove the object if it has more than 1 ptr_records but we are removing both in the loop. And then we are trying to remove all DNS reverse pointers for all the IP's we are removing from the object (which is the same IP as in the list of ptr_records before) which then causes the failure. So we should fix both cases. No DNS ptr record exists (e.g. in already broken customer environments) and the broken removal when multiple pointer records exists. See attached patch.
Fixed in: univention-directory-manager-modules (14.0.15-5) a369142756c4 | Bug #44710: fix removal of dns/ptr_record when no ptr_record would be left over ucs-test (9.0.4-41) 38037ab79edf | Bug #44710: add 66_udm-computers/58_removal_of_leftover_ptr_record_with_multiple_ip_addresses univention-directory-manager-modules.yaml f7ed4cf19632 | YAML Bug #44710
(In reply to Christian Völker from Bug #51736 comment #1) > Notes: > Appears to be a regression as (according to customer) it flawlessly worked > with UCS UCS 4.4-5 e528 but since the upgrade to 4.4-4 e652 the error > appears. This is not a regression. It's broken since ages, probably since UCS 3.
Code: OK Test: OK YAML: OK
*** Bug 51829 has been marked as a duplicate of this bug. ***
<https://errata.software-univention.de/#/?erratum=4.4x712>