Bug 49403

Summary: Traceback unix.py: AttributeError select.error.errno
Product: UCS Reporter: Philipp Hahn <hahn>
Component: Virtualization - UVMMAssignee: Philipp Hahn <hahn>
Status: CLOSED FIXED QA Contact: Erik Damrose <damrose>
Severity: normal    
Priority: P5 Flags: hahn: Patch_Available+
Version: UCS 4.4   
Target Milestone: UCS 4.4-0-errata   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=48536
What kind of report is it?: Bug Report What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 1: Will affect a very few installed domains How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.040 Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:
Attachments: Untested patch

Description Philipp Hahn univentionstaff 2019-05-02 09:13:26 CEST
Created attachment 9999 [details]
Untested patch

==> virtual-machine-manager-daemon-errors.log <==
Traceback (most recent call last):
  File "/usr/sbin/univention-virtual-machine-manager-daemon", line 310, in <module>
    unix(options)
  File "/usr/lib/pymodules/python2.7/univention/uvmm/unix.py", line 206, in unix
    if ex.errno == errno.EINTR:
AttributeError: 'error' object has no attribute 'errno'

src/univention/uvmm/unix.py:
205 »···»···except (select.error, socket.error) as ex:
206 »···»···»···if ex.errno == errno.EINTR:                                                                                          

$ python -c '__import__("socket").error().errno'
$ python -c '__import__("select").error().errno'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'error' object has no attribute 'errno'

<https://docs.python.org/2/library/select.html#select.error>:
> The exception raised when an error occurs. The accompanying value is a pair containing the numeric error code from errno and the corresponding string, as would be printed by the C function perror().

python -c 'import select, errno
try:
  select.select([255], [], [], 1.0)
except select.error as ex:
  errno_, errstr = ex.args
  print(errno_, errno.errorcode[errno_], errstr)'
Comment 1 Philipp Hahn univentionstaff 2019-05-02 09:54:12 CEST
Found while looking at Bug #48536
The bug is harmless as UVMMd is automatically restarted, but let's fix this simple issue now before it gets worse.
QA: I have no reproducer, so code-review is okay by me.

[4.4-0] 91e911fa63 Bug #49403 uvmm: Fix traceback in select.error handling
 .../univention-virtual-machine-manager-daemon/debian/changelog     | 6 ++++++
 .../src/univention/uvmm/unix.py                                    | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

Package: univention-virtual-machine-manager-daemon
Version: 8.0.1-7A~4.4.0.201905020948
Branch: ucs_4.4-0
Scope: errata4.4-0

[4.4-0] c3ddb73c18 Bug #49403: univention-virtual-machine-manager-daemon 8.0.1-7A~4.4.0.201905020948
 .../staging/univention-virtual-machine-manager-daemon.yaml     | 10 ++++++++++
 1 file changed, 10 insertions(+)
Comment 2 Erik Damrose univentionstaff 2019-05-07 16:20:07 CEST
OK: code review
OK: yaml
Verified
Comment 3 Arvid Requate univentionstaff 2019-05-08 13:26:24 CEST
<http://errata.software-univention.de/ucs/4.4/87.html>