Univention Bugzilla – Bug 38110
UDM does not correctly check object existence when modifying objects
Last modified: 2017-04-04 18:29:49 CEST
2015030721000058 # udm groups/group modify --dn "cn=notexistingobject,$ldap_base" --policy-reference="cn=default-umc-all,cn=UMC,cn=policies,$ldap_base" Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 222, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 393, in doit out=_doit(arglist) File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 1042, in _doit if 'univentionPolicyReference' not in lo.get(dn,['objectClass'])['objectClass']: KeyError: 'objectClass' # udm users/user modify --dn "cn=notexistingobject,$ldap_base" --policy-reference="cn=default-umc-all,cn=UMC,cn=policies,$ldap_base" Value is required: The property Primary group is required # udm container/dc modify --dn "dc=notexistingobject,$ldap_base" --policy-reference="cn=default-umc-all,cn=UMC,cn=policies,$ldap_base" No such object: No such object Please also see bug38109
Which UCS errata version?
Probably partly fixed by Bug #37119 (UCS 4.0-0 errata 89). Fixed by the patch from Bug #25174 (attachment 4183 [details]).
No, happened again in #2016012521000249: RUNNING 35univention-management-console-module-appcenter.inst Object exists: cn=UMC,cn=univention,dc=somecustomer,dc=local Object exists: cn=UMC,cn=policies,dc=somecustomer,dc=local Object exists: cn=operations,cn=UMC,cn=univention,dc=somecustomer,dc=local Object exists: cn=default-umc-all,cn=UMC,cn=policies,dc=somecustomer,dc=local Traceback (most recent call last): File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 237, in doit output = univention.admincli.admin.doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 394, in doit out=_doit(arglist) File "/usr/lib/pymodules/python2.6/univention/admincli/admin.py", line 1040, in _doit if 'univentionPolicyReference' not in lo.get(dn,['objectClass'])['objectClass']: KeyError: 'objectClass' EXITCODE=3
(In reply to Sönke Schwardt-Krummrich from comment #3) > No, happened again in #2016012521000249: yes, it would be fixed by the second file in patch attachment 4183 [details].
Created attachment 7662 [details] patch
*** Bug 25174 has been marked as a duplicate of this bug. ***
The prove that the patch doesn't cause any regressions should be svn r57949 / Bug #37119 as well as the following code: 83 » » self.set_defaults = 0 84 » » if not self.dn: # this object is newly created and so we can use the default values 85 » » » self.set_defaults = 1
A slightly adapted version of the patch has been committed: univention-directory-manager-modules (11.0.3-17): r70593 | Bug #38110: raise noObject exception when passing a dn to object.__init__() which's object does not exists.
I found also a wrong usage in base/univention-system-setup/umc/python/setup/netconf/modules/LdapNetwork.py. Maybe this is better for UCS 4.2. I restored the previous behavior. univention-directory-manager-modules (11.0.3-20): r70627 | Bug #38110: restore previous behavior
Created attachment 7767 [details] patch
Re applied that patch and the system setup fix. r75543 | Changelog Bug #38110 univention-system-setup (10.0.0-15): r75542 | Bug #38110: fix UDM usage univention-directory-manager-modules (12.0.10-1): r75541 | Bug #38110: raise noObject when initialiting UDM object with not existing DN
OK: Found 4.1-4, Fixed 4.2-0 OK: r70593 + r70627 in UCS-4.1-2 OK: r75543 r75542 r75541 OK: import univention.admin import univention.admin.uldap as l import univention.admin.handlers.container.cn as cn lo, po = l.getAdminConnection() cn.object(None, lo, po, dn=po.getBase()) # object() cn.object(None, lo, po, dn='cn=foo,'+po.getBase()) # noObject o = cn.object(None, lo, po) o.open() o['name'] = 'test' dn=o.create()
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".