Bug 38362 - UDM-CLI dies when creating a nagios/service object
UDM-CLI dies when creating a nagios/service object
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-24 16:28 CEST by Sönke Schwardt-Krummrich
Modified: 2017-07-26 14:39 CEST (History)
2 users (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?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number:
Bug group (optional): Error handling
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (1.71 KB, patch)
2016-10-30 17:17 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2015-04-24 16:28:07 CEST
Seen on a UCS@school samba3 multiserver environment on a dc slave:

Object created: cn=CItoh,cn=cups,cn=univention,dc=autotest202,dc=local
Object created: cn=Seiko,cn=cups,cn=univention,dc=autotest202,dc=local
Object created: cn=Sharp,cn=cups,cn=univention,dc=autotest202,dc=local
Object created: cn=Olivetti,cn=cups,cn=univention,dc=autotest202,dc=local
Object created: cn=Panasonic,cn=cups,cn=univention,dc=autotest202,dc=local
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 980, in _doit
    dn=object.modify()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 364, in modify
    return self._modify(modify_childs,ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 839, in _modify
    ml=self._ldap_modlist()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/nagios/service.py", line 394, in _ldap_modlist
    fqdn = "%s.%s" % (cn[0], domain[0])
IndexError: list index out of range
Object exists: cn=services,cn=univention,dc=autotest202,dc=local
Object exists: cn=Print,cn=services,cn=univention,dc=autotest202,dc=local
E: object not found
2015-04-24 07:03:33.369789806-04:00 (in joinscript_save_current_version)
EXITCODE=0
RUNNING 79univention-squid.inst
2015-04-24 07:03:33.810919753-04:00 (in joinscript_init)
Object exists: cn=services,cn=univention,dc=autotest202,dc=local
Object exists: cn=PROXY,cn=services,cn=univention,dc=autotest202,dc=local
E: object not found
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 980, in _doit
    dn=object.modify()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 364, in modify
    return self._modify(modify_childs,ignore_license=ignore_license)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 839, in _modify
    ml=self._ldap_modlist()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/nagios/service.py", line 394, in _ldap_modlist
    fqdn = "%s.%s" % (cn[0], domain[0])
IndexError: list index out of range
EXITCODE=3
RUNNING 81univention-nfs-server.inst
EXITCODE=already_executed
Comment 1 Florian Best univentionstaff 2016-10-30 17:17:24 CET
Created attachment 8164 [details]
patch

Treat not existing objects in nagios/service modlist.
Comment 2 Florian Best univentionstaff 2017-07-05 16:33:21 CEST
Patch has been applied, with some small cleanup.

univention-directory-manager-modules (12.0.17-62):
r80885 | Bug #38362: prevent exception if hosts added to nagios/service doesn't exists

univention-directory-manager-modules.yaml:
r80886 | YAML Bug #38362
Comment 3 Florian Best univentionstaff 2017-07-05 16:34:52 CEST
An example to reproduce it is:

udm nagios/service modify --dn cn=UNIVENTION_CUPS,cn=nagios,"$(ucr get ldap/base)" --append assignedHosts=cn=test
Comment 4 Johannes Keiser univentionstaff 2017-07-05 18:57:26 CEST
OK Tested with:
> udm nagios/service modify --dn cn=UNIVENTION_CUPS,cn=nagios,"$(ucr get
> ldap/base)" --append assignedHosts=cn=test

udm nagios/service create --set name=foobar --set checkPeriod=24x7 --set checkCommand=check_foo --set notificationPeriod=24x7 --set assignedHosts=cn=test

YAML: OK
-> verified
Comment 5 Erik Damrose univentionstaff 2017-07-26 14:39:18 CEST
<http://errata.software-univention.de/ucs/4.2/115.html>