Bug 39588 - traceback if directory/manager/web/sizelimit is empty
traceback if directory/manager/web/sizelimit is empty
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.1-3-errata
Assigned To: Florian Best
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-19 11:15 CEST by Florian Best
Modified: 2016-11-03 11:32 CET (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?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016092921000487
Bug group (optional): Error handling, External feedback, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2015-10-19 11:15:09 CEST
We received the following traceback, 4.0-3 errata342 (Walle):

Happend after:
ucr set directory/manager/web/sizelimit=''

Die Ausführung des Kommandos udm/syntax/choices navigation ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 207, in _decorated
    return function(self, request, *args, **kwargs)
  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 941, in _thread
    return read_syntax_choices(request.options['syntax'], request.options)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 163, in _decorated
    return func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 146, in wrapper_func
    return _func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 139, in _func
    ret = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 1482, in read_syntax_choices
    for element in map(map_choice, filter(filter_choice, module.search(filter=filter_s))):
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 163, in _decorated
    return func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 146, in wrapper_func
    return _func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 139, in _func
    ret = func(*args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/udm/udm_ldap.py", line 573, in search
    sizelimit = int(ucr.get('directory/manager/web/sizelimit', '2000'))
ValueError: invalid literal for int() with base 10: ''
Comment 1 Florian Best univentionstaff 2016-10-04 12:28:19 CEST
Reported again, 4.1-3 errata282 (Vahr)
Comment 2 Florian Best univentionstaff 2016-10-13 18:36:05 CEST
One-line-fix.
Just don't crash and take default value. If the UCR variable doesn't contain a int it crashes but I ignore this in the fix. Maybe we someday have ucr.getint().

Reproduce: ucr set directory/manager/web/sizelimit='' and open any UDM UMC module.

univention-management-console-module-udm (6.0.11-26):
r73174 | Bug #39588: don't crash on empty directory/manager/web/sizelimit

univention-management-console-module-udm (7.0.1-10):
r73162 | Bug #39588: don't crash on empty directory/manager/web/sizelimit
Comment 3 Stefan Gohmann univentionstaff 2016-10-18 13:40:19 CEST
Hm, it doesn't work:

root@master431:~# apt-cache policy univention-management-console-module-udm
univention-management-console-module-udm:
  Installiert:           6.0.11-26.662.201610131830
  Installationskandidat: 6.0.11-26.662.201610131830
  Versionstabelle:
 *** 6.0.11-26.662.201610131830 0
        500 http://updates-test.software-univention.de/4.1/maintained/component/ 4.1-3-errata-test/all/ Packages
        100 /var/lib/dpkg/status
     6.0.11-25.657.201609141316 0
        500 https://updates.software-univention.de/4.1/maintained/component/ 4.1-3-errata/all/ Packages
     6.0.11-23.653.201605231616 0
[...]
root@master431:~# apt-cache policy univention-management-console-server
univention-management-console-server:
  Installiert:           8.0.28-19.924.201610141359
  Installationskandidat: 8.0.28-19.924.201610141359
  Versionstabelle:
 *** 8.0.28-19.924.201610141359 0
        500 http://updates-test.software-univention.de/4.1/maintained/component/ 4.1-3-errata-test/all/ Packages
        100 /var/lib/dpkg/status
     8.0.28-18.923.201609011257 0
        500 https://updates.software-univention.de/4.1/maintained/component/ 4.1-3-errata/all/ Packages
[...]

root@master431:~# ucr search --brief directory/manager/web/sizelimit
directory/manager/web/sizelimit: 
root@master431:~# /etc/init.d/univention-management-console-web-server restart
[info] Restarting Univention Management Console Web Server.
Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-web-server", line 60, in <module>
    import univention.management.console.protocol as umcp
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/__init__.py", line 187, in <module>
    from session import *
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 70, in <module>
    from ..acl import LDAP_ACLs
  File "/usr/lib/pymodules/python2.7/univention/management/console/acl.py", line 75, in <module>
    import univention.admin.handlers.computers.domaincontroller_master as dc_master
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/__init__.py", line 44, in <module>
    os.path.walk( path, __walk, path )
  File "/usr/lib/python2.7/posixpath.py", line 238, in walk
    func(arg, top, names)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/__init__.py", line 41, in __walk
    computers.append( __import__( file[ : -3 ], globals(), locals(), [ '' ] ) )
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/memberserver.py", line 42, in <module>
    import univention.admin.nagios as nagios
  File "/usr/lib/pymodules/python2.7/univention/admin/nagios.py", line 57, in <module>
    identifies=0
  File "/usr/lib/pymodules/python2.7/univention/admin/__init__.py", line 204, in __init__
    self.threshold = int(configRegistry.get('directory/manager/web/sizelimit', '2000'))
ValueError: invalid literal for int() with base 10: ''
done.
root@master431:~#
Comment 4 Florian Best univentionstaff 2016-10-18 15:37:06 CEST
univention-directory-manager-modules (11.0.3-37):
r73330 | CHangelog Bug #34764 Bug #39588
r73329 | Bug #39588: don't crash on empty directory/manager/web/sizelimit

univention-directory-manager-modules.yaml:
r73334 | YAML Bug #34764 Bug #39588
Comment 5 Stefan Gohmann univentionstaff 2016-10-18 21:13:09 CEST
OK, works now.

YAML: OK.