Bug 48244 - Traceback in "udm user/user create" if "--set username" is missing
Traceback in "udm user/user create" if "--set username" is missing
Status: CLOSED DUPLICATE of bug 48441
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: Sönke Schwardt-Krummrich
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-30 11:00 CET by Sönke Schwardt-Krummrich
Modified: 2019-07-12 10:30 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.017
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-11-30 11:00:11 CET
If "username" is missing in the UDM CLI argument list during "users/user create", an ugly traceback is shown instead of an useful error message:

master# udm users/user create --position cn=users,dc=example,dc=com \
            --set lastname=Nachname --set password=univention
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 398, in doit
    out = _doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 744, in _doit
    dn = object.create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 536, in create
    self._ldap_pre_ready()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/users/user.py", line 1885, in _ldap_pre_ready
    self.alloc.append(('uid', univention.admin.allocators.request(self.lo, self.position, 'uid', value=self['username'])))
  File "/usr/lib/pymodules/python2.7/univention/admin/allocators.py", line 196, in request
    return acquireUnique(lo, position, type, value, _type2attr[type], scope=_type2scope[type])
  File "/usr/lib/pymodules/python2.7/univention/admin/allocators.py", line 174, in acquireUnique
    univention.admin.locking.lock(lo, position, type, value, scope=scope)
  File "/usr/lib/pymodules/python2.7/univention/admin/locking.py", line 71, in lock
    if not lo.get(dn, ['lockTime']):
  File "/usr/lib/pymodules/python2.7/univention/admin/uldap.py", line 656, in get
    return self.lo.get(dn, attr, required)
  File "/usr/lib/pymodules/python2.7/univention/uldap.py", line 273, in get
    result = self.lo.search_s(dn, ldap.SCOPE_BASE, '(objectClass=*)', attr)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 597, in search_s
    return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 993, in search_ext_s
    return self._apply_method_s(SimpleLDAPObject.search_ext_s,*args,**kwargs)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 931, in _apply_method_s
    return func(self,*args,**kwargs)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 591, in search_ext_s
    return self.result(msgid,all=1,timeout=timeout)[1]
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 503, in result
    resp_type, resp_data, resp_msgid = self.result2(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 507, in result2
    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all,timeout)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 514, in result3
    resp_ctrl_classes=resp_ctrl_classes
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 521, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 106, in _ldap_call
    result = func(*args,**kwargs)
INVALID_DN_SYNTAX: {'info': 'invalid DN', 'desc': 'Invalid DN syntax'}
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2019-01-10 09:56:34 CET

*** This bug has been marked as a duplicate of bug 48441 ***
Comment 2 Florian Best univentionstaff 2019-07-12 10:30:57 CEST

<http://errata.software-univention.de/ucs/4.4/19.html>