Bug 51524 - ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
Summary: ERROR:univention.service_info:Failed getting parent: invalid literal for int(...
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: UCR
Version: UCS 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.0
Assignee: Florian Best
QA Contact: Arvid Requate
URL:
Keywords:
: 52494 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-18 14:44 CEST by Florian Best
Modified: 2021-05-25 16:01 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (876 bytes, patch)
2020-06-18 14:54 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-06-18 14:44:44 CEST
The parsing of /proc/$PID/stat in univention.service_info is broken.

In the test case 86_selenium/137_appcenter we see a lot of error messages being logged:

https://jenkins.knut.univention.de:8181/job/UCS-4.4/job/UCS-4.4-4/job/AutotestJoin/102/SambaVersion=samba-pdc,Systemrolle=slave/testReport/86_selenium/137_appcenter/slave098/

```
INFO:univention.service_info:Found docker.pid=314
INFO:univention.service_info:found 375: '/sbin/rpcbind\x00-f\x00-w'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
INFO:univention.service_info:Found docker.pid=314
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
INFO:univention.service_info:found 9989: '/usr/sbin/rpc.mountd\x00--manage-gids\x00--port\x0032767'
INFO:univention.service_info:Found docker.pid=314
INFO:univention.service_info:found 1080: '/bin/bash\x00/usr/bin/univention-welcome-screen'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
INFO:univention.service_info:Found docker.pid=314
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
ERROR:univention.service_info:Failed getting parent: invalid literal for int() with base 10: 'S'
INFO:univention.service_info:found 19598: '/usr/sbin/cron\x00-f'
INFO:univention.service_info:found 20787: '/usr/sbin/cron\x00-f'
``
…

Reproducible:
python -c "import setproctitle, os, glob; setproctitle.setproctitle('foo bar baz'); [open(fn).read().split()[3] for fn in glob.glob('/proc/*/stat') if not os.path.isdir(fn)]"
Comment 1 Florian Best univentionstaff 2020-06-18 14:54:51 CEST
Created attachment 10396 [details]
patch
Comment 2 Florian Best univentionstaff 2020-12-15 12:05:51 CET
*** Bug 52494 has been marked as a duplicate of this bug. ***
Comment 3 Florian Best univentionstaff 2020-12-15 15:12:20 CET
Fixed in:

univention-config-registry (15.0.5-1)
83bb7447ac8f | Bug #51524: fix parsing of /proc/*/stat in service_info.py

changelog-5.0-0.xml
ce0033854b29 | Changelog Bug #51524
Comment 4 Florian Best univentionstaff 2021-01-21 00:38:05 CET
The new implementation failed for:
'13607 (kdc(0)) S 13603 13561 13561 0 -1 4194368 1450 0 0 0 4 2 0 0 20 0 1 0 250232 134688768 9770 18446744073709551615 94439192449024 94439192475205 140728993593568 0 0 0 6784 1052672 17505 1 0 0 17 1 0 0 0 0 0 94439192492096      94439192495232 94439193116672 140728993595189 140728993595208 140728993595208 140728993595368 0\n'
    
`man 5 proc` describes the format.
I now looked up the implementation from `psutil/_pslinux.py:Process._parse_stat_file()`.

univention-config-registry (15.0.6-1)
43e2df69b4b0 | Bug #51524: fix univention.service_info.pidof()
Comment 5 Florian Best univentionstaff 2021-05-25 16:01:22 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".