Univention Bugzilla – Bug 44389
creating computer causes IndexError: list index out of range
Last modified: 2019-02-27 18:05:52 CET
Version: 4.2-0 errata0 (Lesum) Remark: Einen PC unter Netzwerk-Einstellungen ein Netzwerk zugeordnet. Netzwerk wurde vorher angelegt. 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 406, 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 143, 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 318, in modify return self._modify(modify_childs, ignore_license=ignore_license) File "%PY2.7%/univention/admin/handlers/__init__.py", line 814, in _modify self._ldap_post_modify() File "%PY2.7%/univention/admin/handlers/computers/windows.py", line 512, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2001, in _ldap_post_modify zoneIsV6 = explode_dn(x, 1)[0].endswith('.ip6.arpa') IndexError: list index out of range
Version: 4.2-0 errata4 (Lesum) Remark: wollte IP-Adresse ändern
It seems in UDM-UMC the syntax classes aren't checked while via UDM-CLI they are. Reproducer: curl 'http://Administrator:univention@xen3.school.local/univention/command/udm/put' -H 'Accept-Language: de-DE' -H 'Content-Type: application/json' -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' --data-binary '{"options":[{"object":{"ip":["192.168.0.4"],"dnsEntryZoneForward":[["zoneName=school.local,cn=dns,dc=school,dc=local","192.168.0.4"]],"dnsEntryZoneReverse":[["","192.168.0.4"]],"$dn$":"cn=member,cn=computers,dc=school,dc=local"},"options":null}],"flavor":"computers/computer"}' # udm computers/memberserver modify --dn cn=member,dc=school,dc=local --set ip=10.200.27.222 --append dnsEntryZoneReverse='"" "192.168.0.4"' Invalid syntax: dnsEntryZoneReverse: Not a valid LDAP DN
The syntax class "dnsEntryReverse" and "DNS_ReverseZone" currently allow empty values to be set. The behavior of the UDM-CLI and UDM-UMC differ: 263 » » » elif univention.admin.syntax.is_syntax(module.property_descriptions[key].syntax, univention.admin.syntax.complex): → There is a special case for complex syntaxes. All empty strings are stripped from the list. 279 » » » » » » object[key] = [val] → This results in the valueError exception here because val is ['192.168.0.4'] instead of ['', '192.168.0.4']. Therefore the subsyntax checks if '192.168.0.4' is a valid LDAP DN. So the UDM-CLI fails by accident. And UMC checks the syntax more correctly but the value is accepted as valid: >>> univention.admin.syntax.dnsEntryReverse.parse([['', '192.168.0.4']][0]) ['', '192.168.0.4']
Imho _map_properties() (UMC) and object_input() (CLI) should nearly do the same.
*** Bug 44239 has been marked as a duplicate of this bug. ***
Die Ausführung des Kommandos udm/put computers/computer ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run tmp = self._function() File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 406, in _thread module.modify(properties) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated return method(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 445, in modify obj.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 318, in modify return self._modify(modify_childs, ignore_license=ignore_license) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 793, in _modify self._ldap_pre_modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/linux.py", line 508, in _ldap_pre_modify univention.admin.handlers.simpleComputer._ldap_pre_modify(self) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2249, in _ldap_pre_modify self.check_common_name_length() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1691, in check_common_name_length zoneName = univention.admin.uldap.explodeDn(zone[0], 1)[0] IndexError: list index out of range
(In reply to Florian Best from comment #6) To reproduce the traceback, create a network object with only a network address and a subnet mask defined. udm networks/network create --set network=10.200.27.0 --set netmask=24 --set name=test Then create a computer object via UMC and assign the network object to the computer object. UMC sets a IP address but no reverse zone. curl 'http://Administrator:univention@10.200.27.130/univention/command/udm/add' -H 'Content-Type: application/json' -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' --data-binary '{"options":[{"object":{"ip":["10.200.27.4"],"network":"cn=test,dc=school,dc=local","unixhome":"/dev/null","shell":"/bin/bash","primaryGroup":"cn=Computers,cn=groups,dc=school,dc=local","dnsEntryZoneForward":[["","10.200.27.4"]],"name":"test3","dnsEntryZoneReverse":[["","10.200.27.4"]],"$options$":{"kerberos":true,"nagios":false,"posix":true,"samba":true},"$policies$":{}},"options":{"container":"cn=computers,dc=school,dc=local","objectType":"computers/linux","objectTemplate":"None"}}],"flavor":"computers/computer"}'
Reported 3 times again, Version: 4.2-1 errata144 (Lesum)
Version: 4.2-2 errata189 (Lesum) - UCS@school 4.2 v3
Version: 4.2-2 errata189 (Lesum)
A draft for a patch has been implemented in fbest/44389-creating-computer-causes-index-error. The patch fixes the syntax validation of some required fields. Additionally it fixes the UDM CLI complex syntax validation so that it behaves like UMC does.
Reported again: Version: 4.2-3 errata262 (Lesum) - UCS@school 4.2 v6 Remark: on ipv6 address was configured, the mac removed, the reverse zone emptied, IPv4s set to ***
dnsEntry and dnsEntryReverse may not have empty DNS_ReverseZone or DNS_ForwardZone anymore.
(In reply to Florian Best from comment #12) > A draft for a patch has been implemented in > fbest/44389-creating-computer-causes-index-error. The patch fixes the syntax > validation of some required fields. Additionally it fixes the UDM CLI > complex syntax validation so that it behaves like UMC does. It seems your patch does the same as mine except that the CLI-fix is not applied. We should clone this bug then.
OK The reverse/forward zone on an DNS entry of a computer can not be empty -> verified Cloning Bug for CLI fix
<http://errata.software-univention.de/ucs/4.3/13.html>
Reported again: Version: 4.2-3 errata418 (Lesum) Internal server error during "udm/add (computers/computer)". Request: udm/add (computers/computer) 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 369, in _thread dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate')) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 82, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 393, in create obj.create() File "%PY2.7%/univention/admin/handlers/__init__.py", line 381, in create dn = self._create(response=response, serverctrls=serverctrls) File "%PY2.7%/univention/admin/handlers/__init__.py", line 986, in _create self._ldap_pre_create() File "%PY2.7%/univention/admin/handlers/computers/linux.py", line 393, in _ldap_pre_create super(object, self)._ldap_pre_create() File "%PY2.7%/univention/admin/handlers/__init__.py", line 2539, in _ldap_pre_create self.check_common_name_length() File "%PY2.7%/univention/admin/handlers/__init__.py", line 1984, in check_common_name_length zoneName = univention.admin.uldap.explodeDn(zone[0], 1)[0] IndexError: list index out of range
Reported again: Version: 4.2-3 errata418 (Lesum) Internal server error during "udm/put (computers/computer)". Request: udm/put (computers/computer) 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 407, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 82, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 453, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 419, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1067, in _modify self._ldap_pre_modify() File "%PY2.7%/univention/admin/handlers/computers/windows.py", line 526, in _ldap_pre_modify univention.admin.handlers.simpleComputer._ldap_pre_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2542, in _ldap_pre_modify self.check_common_name_length() File "%PY2.7%/univention/admin/handlers/__init__.py", line 1984, in check_common_name_length zoneName = univention.admin.uldap.explodeDn(zone[0], 1)[0] IndexError: list index out of range Role: domaincontroller_master
External feedback: UCS Version: 4.3-0 errata11 (Neustadt) Interner Server-Fehler in "udm/put (computers/computer)". Request: udm/put (computers/computer) Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run tmp = self._function() File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 407, in _thread module.modify(properties) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 83, in _decorated return method(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 454, in modify obj.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 526, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1076, in _modify self._ldap_post_modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/windows.py", line 512, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2316, in _ldap_post_modify zoneIsV6 = explode_dn(x, 1)[0].endswith('.ip6.arpa') IndexError: list index out of range
Reported again: Version: 4.2-5 errata567 (Lesum) Remark: changed IP and network of a computer client Internal server error during "udm/put (computers/computer)". Request: udm/put (computers/computer) File "%PY2.7%/notifier/threads.py", line 78, 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 407, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 82, in _decorated return method(*args, **kwargs) File "%PY2.7%/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 453, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 419, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1067, in _modify self._ldap_pre_modify() File "%PY2.7%/univention/admin/handlers/computers/ipmanagedclient.py", line 274, in _ldap_pre_modify univention.admin.handlers.simpleComputer._ldap_pre_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2542, in _ldap_pre_modify self.check_common_name_length() File "%PY2.7%/univention/admin/handlers/__init__.py", line 1984, in check_common_name_length zoneName = univention.admin.uldap.explodeDn(zone[0], 1)[0] IndexError: list index out of range Role: domaincontroller_master