Univention Bugzilla – Full Text Bug Listing |
Summary: | ValueError while adding third MAC with same IP address ("min() arg is an empty sequence") | ||
---|---|---|---|
Product: | UCS | Reporter: | Florian Best <best> |
Component: | UMC - DHCP | Assignee: | Florian Best <best> |
Status: | CLOSED FIXED | QA Contact: | Philipp Hahn <hahn> |
Severity: | normal | ||
Priority: | P5 | CC: | andreas.lemke, gulden, hahn, keiser, scheinig, steuwer, troeder, voelker, xoxys |
Version: | UCS 4.4 | Flags: | best:
Patch_Available+
|
Target Milestone: | UCS 4.4-2-errata | ||
Hardware: | Other | ||
OS: | Linux | ||
See Also: |
https://forge.univention.org/bugzilla/show_bug.cgi?id=35612 https://forge.univention.org/bugzilla/show_bug.cgi?id=16923 |
||
What kind of report is it?: | Bug Report | What type of bug is this?: | 7: Crash: Bug causes crash or data loss |
Who will be affected by this bug?: | 3: Will affect average number of installed domains | How will those affected feel about the bug?: | 2: A Pain – users won’t like this once they notice it |
User Pain: | 0.240 | Enterprise Customer affected?: | Yes |
School Customer affected?: | Yes | ISV affected?: | |
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | 2019022221000498, 2019012121000223, 2019090321000191, 2018082721000569, 2018042721001128, 2018041321001092, 2018040721001031, 2018042721000558, 2018031621001052, 2018021521001118, 2017070421000669, 2017090921000067, 2017112121000682, 2018101921000561 | Bug group (optional): | External feedback |
Max CVSS v3 score: | |||
Attachments: | patch |
Description
Florian Best
2017-07-05 08:55:07 CEST
Version: 4.2-1 errata159 (Lesum) Remark: Es können keine DHCP-Einträge mehr zu Rechnern hinzugefügt werden Reported again: Version: 4.2-2 errata219 (Lesum) Reported again: Version: 4.2-3 errata305 (Lesum) Remark: Trat beim hinzufügen eines ip-managed clients mit drei MAC adressen die alle auf die selbe IP laufen sollen auf. Interner Server-Fehler in "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 1038, in _create self._ldap_post_create() File "%PY2.7%/univention/admin/handlers/computers/ipmanagedclient.py", line 262, in _ldap_post_create univention.admin.handlers.simpleComputer._ldap_post_create(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2563, in _ldap_post_create self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1655, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Reported again: Version: 4.2-3 errata312 (Lesum) Reported again: Version: 4.2-3 errata342 (Lesum) Version: 4.3-0 errata11 (Neustadt) Reported again: Version: 4.2-3 errata313 (Lesum) Remark: Bearbeiten des Eintrags zu System nc407-muc -> Fehlermeldung. -> löschen dieses Eintrags. -> neuanlegen dieses Eintrags. -> Fehler bleibt bestehen! Reported again: Version: 4.3-0 errata22 (Neustadt) Reported again: Version: 4.3-1 errata202 (Neustadt) - UCS@school 4.3 v4 Remark: Änderung der MAC-Adresse Interner Server-Fehler in "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 83, 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 454, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 582, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1223, 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 2400, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1861, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Reported again: Version: 4.3-2 errata237 (Neustadt) Interner Server-Fehler in "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 83, 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 454, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 582, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1223, 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 2400, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1861, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence > n = min(set(range(max(taken) + 1)) - taken) if taken else 0
> ValueError: min() arg is an empty sequence
This can happen in only 1 case: taken = set([0])
→ min(set(range(max(0) + 1)) - {0})
→ min(set(range(1)) - {0})
→ min(set([0]) - {0})
→ min({0} - {0})
→ min(set())
→ ValueError: min() arg is an empty sequence
taken is created from a list of hostnames of the form '.*_uv(\d+)'. So if only 1 host exists with a name '*_uv0', this happens.
Reported again: Version: 4.3-2 errata407 (Neustadt) Remark: Fehlermeldung erscheint beim hinzufügen einer zusätzlichen Mac-Adresse mit DNS Fwd und DNS Rev + DHCP Eintrag. Interner Server-Fehler in "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 431, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 84, 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 455, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 583, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1224, in _modify self._ldap_post_modify() File "%PY2.7%/univention/admin/handlers/computers/linux.py", line 494, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2444, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1905, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Role: domaincontroller_master Reported again: Version: 4.3-3 errata428 (Neustadt) Remark: Diesen Fehler erhalte ich, wenn ich bei einem Rechnerkonto mehrere Netzwerk-Schnittstellen eintragen will. Interner Server-Fehler in "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 431, in _thread module.modify(properties) File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 84, 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 455, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 583, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1224, 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 2444, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1905, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Role: domaincontroller_master Reproducible: DN: cn=test,cn=computers,dc=dev,dc=local description: None dhcpEntryZone: cn=asdf,cn=dhcp,dc=dev,dc=local 10.200.27.3 11:22:33:44:66:55 dhcpEntryZone: cn=asdf,cn=dhcp,dc=dev,dc=local 10.200.27.2 11:22:33:44:66:44 dnsEntryZoneForward: zoneName=dev.local,cn=dns,dc=dev,dc=local 10.200.27.2 dnsEntryZoneReverse: zoneName=27.200.10.in-addr.arpa,cn=dns,dc=dev,dc=local 10.200.27.2 domain: dev.local fqdn: test.dev.local ip: 10.200.27.4 ip: 10.200.27.3 ip: 10.200.27.2 mac: 11:22:33:44:66:55 mac: 11:22:33:44:66:66 mac: 11:22:33:44:66:44 name: test network: cn=default,cn=networks,dc=dev,dc=local # udm computers/ipmanagedclient modify --dn cn=test,cn=computers,dc=dev,dc=local --append dhcpEntryZone='"cn=asdf,cn=dhcp,dc=dev,dc=local" "10.200.27.2" "11:22:33:44:66:44"' --append dhcpEntryZone='"cn=asdf,cn=dhcp,dc=dev,dc=local" "10.200.27.3" "11:22:33:44:66:55"' --append dhcpEntryZone='"cn=asdf,cn=dhcp,dc=dev,dc=local" "10.200.27.4" "11:22:33:44:66:66"' Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 218, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 408, in doit out = _doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 904, in _doit dn = object.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 635, 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 1309, in _modify self._ldap_post_modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/ipmanagedclient.py", line 272, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2591, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2052, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence (Pdb) taken set([0]) (Pdb) results ['cn=test,cn=asdf,cn=dhcp,dc=dev,dc=local', 'cn=test_uv0,cn=asdf,cn=dhcp,dc=dev,dc=local'] Added a test case which reproduces the problem, tag=SKIP. ucs-test (9.0.2-37) ba9ac52e195f | Bug #44937: 66_udm-computers/57_multiple_dhcp_entry_zones Created attachment 9980 [details]
patch
Version 4.3-3 errata 477 (Neustadt) Das Anlegen eines Rechnerobjekts mit 3 DHCP Einträgen gibt folgenden Traceback: Interner Server-Fehler in "udm/add (computers/computer)". Request: udm/add (computers/computer) File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 78, 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 393, in _thread dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate')) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 84, 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 395, in create obj.create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 539, in create dn = self._create(response=response, serverctrls=serverctrls) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1180, in _create self._ldap_post_create() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/ipmanagedclient.py", line 262, in _ldap_post_create univention.admin.handlers.simpleComputer._ldap_post_create(self) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2813, in _ldap_post_create self.__modify_dhcp_object(dn, mac, ip=ip) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1905, in _modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Ein Hotfix hat Abhilfe verschaft: --- /usr/share/pyshared/univention/admin/handlers/__init__.old.py 2019-03-15 18:56:54.808000000 +0100 +++ /usr/share/pyshared/univention/admin/handlers/__init__.py 2019-03-15 18:56:58.600000000 +0100 @@ -2049,7 +2049,7 @@ univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'the host "%s" already has a dhcp object, so we search for the next free uv name' % (name)) RE = re.compile(r'cn=[^,]+_uv(\d+),') taken = set(int(m.group(1)) for m in (RE.match(dn) for dn in results) if m) - n = min(set(range(max(taken) + 1)) - taken) if taken else 0 + n = min(set(range(max(taken) + 2)) - taken) if taken else 0 name = '%s_uv%d' % (name, n) dn = 'cn=%s,%s' % (escape_dn_chars(name), position) Dies ist aber ohne weitere Überprüfung keine dauerhafte Lösung. Will this issue be fixed in the near future? Reported again: Version: 4.3-4 errata481 (Neustadt) Ticket#2019052021000512 Interner Server-Fehler in "udm/add (computers/computer)". Request: udm/add (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 393, 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 84, 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 395, in create obj.create() File "%PY2.7%/univention/admin/handlers/__init__.py", line 539, in create dn = self._create(response=response, serverctrls=serverctrls) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1180, in _create self._ldap_post_create() File "%PY2.7%/univention/admin/handlers/computers/windows.py", line 474, in _ldap_post_create univention.admin.handlers.simpleComputer._ldap_post_create(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2813, in _ldap_post_create self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1905, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence Reported again: Version: 4.4-0 errata51 (Blumenthal) Ticket#2019041821000804 Interner Server-Fehler in "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 428, 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 612, in modify obj.modify() File "%PY2.7%/univention/admin/handlers/__init__.py", line 635, in modify dn = self._modify(modify_childs, ignore_license=ignore_license, response=response) File "%PY2.7%/univention/admin/handlers/__init__.py", line 1309, in _modify self._ldap_post_modify() File "%PY2.7%/univention/admin/handlers/computers/__base.py", line 208, in _ldap_post_modify univention.admin.handlers.simpleComputer._ldap_post_modify(self) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2591, in _ldap_post_modify self.__modify_dhcp_object(dn, mac, ip=ip) File "%PY2.7%/univention/admin/handlers/__init__.py", line 2052, in __modify_dhcp_object n = min(set(range(max(taken) + 1)) - taken) if taken else 0 ValueError: min() arg is an empty sequence *** Bug 49752 has been marked as a duplicate of this bug. *** Again: Ticket #2019080921000412 Version: 4.3-4 errata552 (Neustadt) Remark: nc407-muc war angelegt, wurde gelöscht. Neu anlegen schlug fehl mit o.a. Fehler. Gefunden wurden mehrere weitere Objekte mit cn=nc407-muc. Diese Objekte wurden ebenfalls gelöscht. Trotzdem funktioniert neuanlegen des Objekts nicht! (In reply to Florian Best from comment #22) > Gefunden wurden mehrere weitere Objekte mit cn=nc407-muc. Diese Objekte > wurden ebenfalls gelöscht. Trotzdem funktioniert neuanlegen des Objekts > nicht! uidNumber in temporary? (In reply to Daniel Tröder from comment #23) > (In reply to Florian Best from comment #22) > > Gefunden wurden mehrere weitere Objekte mit cn=nc407-muc. Diese Objekte > > wurden ebenfalls gelöscht. Trotzdem funktioniert neuanlegen des Objekts > > nicht! > uidNumber in temporary? The comment is probably unrelated to the problem. We should stick to the attached patch. The customer needs the third MAC for laptops with docking stations. Ich habe das selbe Problem. Es tritt auf wenn eine dritte MAC Adresse zum DHCP Bereich hinzugefügt wird. Alle MAC Adressen bekommen die selbe IP bzw. eine dynamische IP. The patch has been applied: ucs-test (9.0.3-78) d45864e21c12 | Bug #44937: re enable test case univention-directory-manager-modules (14.0.14-3) 9250e8b2febe | Bug #44937: fix DHCP assignment for computers with mutliple MAC addresses ucs-test (9.0.2-37) ba9ac52e195f | Bug #44937: 66_udm-computers/57_multiple_dhcp_entry_zones univention-directory-manager-modules.yaml 9250e8b2febe | Bug #44937: fix DHCP assignment for computers with mutliple MAC addresses OK: errata-announce -V --only univention-directory-manager-modules.yaml FIXED: univention-directory-manager-modules.yaml [4.4-2] d87b5de187 Bug #50288: univention-directory-manager-modules 14.0.14-3A~4.4.0.201910101102 doc/errata/staging/univention-directory-manager-modules.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) OK: apt install {python-univention-directory-manager,python-univention-directory-manager-cli,univention-directory-manager-tools}=14.0.14-5A~4.4.0.201910101215 OK: pkill -f univention-cli-serve lb="$(ucr get ldap/base)" service="$(udm dhcp/service list|sed -ne 's/^DN: //p;T;q')" ip1='1.2.3.4' ip2='1.2.3.5' ip3='1.2.3.6' mac1='00:11:22:33:44:55' mac2='00:11:22:33:44:66' mac3='00:11:22:33:44:77' udm computers/linux create \ --set name=bug44937\ --append ip="$ip1" \ --append ip="$ip2" \ --append mac="$mac1" \ --append mac="$mac2" \ --append dhcpEntryZone="\"$service\" \"$ip1\" \"$mac1\"" \ --append dhcpEntryZone="\"$service\" \"$ip2\" \"$mac2\"" udm computers/linux modify \ --dn "cn=bug44937,$lb" \ --append ip="$ip3" \ --append mac="$mac3" \ --append dhcpEntryZone="\"$service\" \"$ip3\" \"$mac3\"" udm dhcp/host list udm computers/linux remove --remove_referring \ --dn "cn=bug44937,$lb" |