Bug 49354 - Traceback in "Überprüfe freien Festplatten Platz": ValueError: invalid literal for int() with base 10: 'none
Traceback in "Überprüfe freien Festplatten Platz": ValueError: invalid litera...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - System diagnostic
UCS 4.4
Other Mac OS X 10.1
: P5 normal (vote)
: UCS 5.0-1-errata
Assigned To: Christian Castens
Florian Best
:
: 50247 51523 52803 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-25 17:47 CEST by Michel Smidt
Modified: 2022-02-16 12:06 CET (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a 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.114
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Max CVSS v3 score:
castens: Patch_Available+


Attachments
Patch for bug 49354 (296 bytes, patch)
2020-01-29 10:26 CET, Christian Castens
Details | Diff
Patch for bug 49354 (911 bytes, patch)
2020-01-29 12:41 CET, Christian Castens
Details | Diff
Patch for bug 49354 (1.24 KB, patch)
2020-01-29 13:18 CET, Christian Castens
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Smidt 2019-04-25 17:47:56 CEST
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'
Comment 1 Florian Best univentionstaff 2019-11-28 10:36:30 CET
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
Comment 2 Michel Smidt 2019-11-29 14:23:52 CET
Raise the type of bug because it is definitely a key scenario
Comment 3 Christian Castens univentionstaff 2020-01-29 10:26:52 CET
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.
Comment 4 Christian Castens univentionstaff 2020-01-29 10:27:26 CET
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.
Comment 5 Christian Castens univentionstaff 2020-01-29 12:41:35 CET
Created attachment 10286 [details]
Patch for bug 49354
Comment 6 Christian Castens univentionstaff 2020-01-29 13:18:12 CET
Created attachment 10288 [details]
Patch for bug 49354
Comment 7 Christian Völker univentionstaff 2020-04-15 10:41:23 CEST
Happened again. See forum:
https://help.univention.com/t/mariadb-wont-start/14830
Comment 8 Christian Völker univentionstaff 2020-04-15 10:42:26 CEST
*** Bug 50247 has been marked as a duplicate of this bug. ***
Comment 9 Julia Bremer univentionstaff 2020-06-18 10:31:13 CEST
*** Bug 51523 has been marked as a duplicate of this bug. ***
Comment 10 Julia Bremer univentionstaff 2021-02-16 17:40:00 CET
*** Bug 52803 has been marked as a duplicate of this bug. ***
Comment 11 Florian Best univentionstaff 2021-02-17 08:55:04 CET
(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 12 Christian Castens univentionstaff 2021-02-17 12:53:46 CET
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()
Comment 13 Christian Castens univentionstaff 2021-02-17 12:56:23 CET
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()
Comment 14 Christian Castens univentionstaff 2022-02-08 10:02:23 CET
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
Comment 15 Florian Best univentionstaff 2022-02-08 10:57:04 CET
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