Univention Bugzilla – Bug 49354
Traceback in "Überprüfe freien Festplatten Platz": ValueError: invalid literal for int() with base 10: 'none
Last modified: 2022-02-16 12:06:41 CET
Got a traceback in the Problem: "Überprüfe freien Festplatten Platz" Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 275, in execute result = execute(umc_module, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 136, in run if problem_on_varlog and high_log_levels(): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 108, in high_log_levels return any(check(configRegistry) for check in checks) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 108, in return any(check(configRegistry) for check in checks) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 73, in return lambda ucr: int(ucr.get(variable, default)) > default ValueError: invalid literal for int() with base 10: 'none'
Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/__init__.py", line 275, in execute result = execute(umc_module, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 136, in run if problem_on_varlog and high_log_levels(): File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 108, in high_log_levels return any(check(configRegistry) for check in checks) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 73, in· return lambda ucr: int(ucr.get(variable, default)) > default ValueError: invalid literal for int() with base 10: 'none
Raise the type of bug because it is definitely a key scenario
Created attachment 10285 [details] Patch for bug 49354 In Bug 47196 (https://forge.univention.org/bugzilla/show_bug.cgi?id=47196standard) default debug level of 'ldap/debug/level' was changed from '0' to 'none'. In file '30_disk_usage.py' a change from int-value '0' to string-value 'none' caused the program to crash since it was not able to make a comparison between two integers anymore. With the attached patch file this behavior has been fixed.
In Bug 47196 (https://forge.univention.org/bugzilla/show_bug.cgi?id=47196standard) default debug level of 'ldap/debug/level' was changed from '0' to 'none'. In file '30_disk_usage.py' a change from int-value '0' to string-value 'none' caused the program to crash since it was not able to make a comparison between two integers anymore. With the attached patch file this behavior has been fixed.
Created attachment 10286 [details] Patch for bug 49354
Created attachment 10288 [details] Patch for bug 49354
Happened again. See forum: https://help.univention.com/t/mariadb-wont-start/14830
*** Bug 50247 has been marked as a duplicate of this bug. ***
*** Bug 51523 has been marked as a duplicate of this bug. ***
*** Bug 52803 has been marked as a duplicate of this bug. ***
(In reply to Christian Castens from comment #6) > Created attachment 10288 [details] > Patch for bug 49354 The patch won't work for 0 because it is checked for a string against an integer.
Comment on attachment 10288 [details] Patch for bug 49354 >diff --git management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/30_disk_usage.py management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/30_disk_usage.py >index 4bc7e8242a..24c6544718 100755 >--- management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/30_disk_usage.py >+++ management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/30_disk_usage.py >@@ -82,7 +82,6 @@ def high_log_levels(): > is_high('directory/manager/cmd/debug/level', 0), > is_high('dns/debug/level', 0), > is_high('dns/dlz/debug/level', 0), >- is_high('ldap/debug/level', 0), > is_high('listener/debug/level', 2), > is_high('mail/postfix/ldaptable/debuglevel', 0), > is_high('notifier/debug/level', 1), >@@ -100,7 +99,8 @@ def high_log_levels(): > is_on('saml/idp/log/debug/enabled'), > is_on('pdate/check/boot/debug'), > is_on('update/check/cron/debug'), >- lambda ucr: ucr.get('apache2/loglevel', 'warn') in ('notice', 'info', 'debug') >+ lambda ucr: ucr.get('apache2/loglevel', 'warn') in ('notice', 'info', 'debug'), >+ lambda ucr: ucr.get('ldap/debug/level', 'none') not in ('none', '0') > ) > > configRegistry = univention.config_registry.ConfigRegistry()
Patch applied. Disk usage checks will now handle log level evaluations of UCR variable ldap/debug/level correctly. Successful build Package: univention-management-console-module-diagnostic Version: 6.0.0-24A~5.0.0.202202072000 Branch: ucs_5.0-0 Scope: errata5.0-1
OK: problem reproduced: (ucr set ldap/debug/level=stats, no free space on /var/log, no high debug level before the LDAP check) # univention-run-diagnostic-checks --username Administrator --bindpwdfile <(echo -en univention) -t 30_disk_usage Executing following checks: ['30_disk_usage'] You can find the logging messages of the diagnostic modules at /var/log/univention/management-console-module-diagnostic.log ######################## Start 30_disk_usage ######################### ## Check failed: 30_disk_usage - Überprüfe freien Festplatten Platz ## Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/__init__.py", line 280, in execute result = execute(umc_module, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 136, in run if high_log_levels(): File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 108, in high_log_levels return any(check(configRegistry) for check in checks) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 108, in <genexpr> return any(check(configRegistry) for check in checks) File "/usr/lib/python3/dist-packages/univention/management/console/modules/diagnostic/plugins/30_disk_usage.py", line 73, in <lambda> return lambda ucr: int(ucr.get(variable, default)) > default ValueError: invalid literal for int() with base 10: 'stats' OK: problem fixed OK: YAML OK: code review
<https://errata.software-univention.de/#/?erratum=5.0x225>