Bug 51353 - Migrate univention-management-console-web-server to Python 3
Migrate univention-management-console-web-server to Python 3
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-4-errata
Assigned To: Florian Best
Dirk Wiesenthal
:
Depends on: 51235
Blocks: 51299
  Show dependency treegraph
 
Reported: 2020-05-25 16:10 CEST by Florian Best
Modified: 2020-06-17 15:39 CEST (History)
2 users (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):
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-05-25 16:10:02 CEST
The Univention Management Console Web Server needs to be python 3 compatible.

Additionally I found an error in the current python3 status of UMC-ModuleProcesses:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 354, in _do_send
    ret = self.__comm.send(self.__queue)
BrokenPipeError: [Errno 32] Datenübergabe unterbrochen (broken pipe)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-module", line 121, in <module>
    notifier.loop()
  File "/usr/lib/python3/dist-packages/notifier/nf_generic.py", line 296, in loop
    step()
  File "/usr/lib/python3/dist-packages/notifier/nf_generic.py", line 282, in step
    if cond & condition and fd in __sockets[cond] and not __sockets[cond][fd](sock_obj):
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 212, in _recv
    self.error_handling(msg, 'init', *sys.exc_info())
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 219, in error_handling
    self.__handler._Base__error_handling(request, method, etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 388, in __error_handling
    self.finished(request.id, result, message, status=status, headers=headers, error=error)
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 484, in finished
    self.result(res)
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 488, in result
    self.signal_emit('success', response)
  File "/usr/lib/python3/dist-packages/notifier/signals.py", line 84, in signal_emit
    self.__signals[signal].emit(*args)
  File "/usr/lib/python3/dist-packages/notifier/signals.py", line 49, in emit
    cb(*args)
  File "/usr/lib/python3/dist-packages/notifier/__init__.py", line 104, in __call__
    return self._function(*tmp, **self._kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 137, in _reply
    self.response(msg)
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 376, in response
    if self._do_send(self.__comm):
  File "/usr/lib/python3/dist-packages/univention/management/console/protocol/modserver.py", line 356, in _do_send
    if e[0] == errno.EWOULDBLOCK:
TypeError: 'BrokenPipeError' object is not subscriptable


Patch available in: python3/5.0-0

+++ This bug was initially created as a clone of Bug #51235 +++
Comment 1 Florian Best univentionstaff 2020-06-04 09:27:56 CEST
Fixed:
* Migrate UMC-Webserver to be Python 3 compatible
    
* The check for the maximum Content-Length when sending an auth request did not work and has been fixed:
    
$ curl http://localhost:8090/auth -H 'Content-Type: application/json' -d @<(python -c 'import json; print(json.dumps({"username": "A" * 1024 * 2000}))')
    {"status": 413, "message": "Request data is too large, allowed length is 2048000", "traceback": null, "location": "http://localhost:8090/univention/auth"}
    
* An error in the handling of socket exceptions has been fixed:
comment #0

univention-management-console.yaml
b2f256f4ca04 | Bug #51353: Merge branch 'fbest/umc-webserver-python3' into 4.4-4
633f0cef884a | YAML Bug #51353

univention-management-console (11.0.4-80)
b2f256f4ca04 | Bug #51353: Merge branch 'fbest/umc-webserver-python3' into 4.4-4
3ebe97b6fd5b | Bug #51353: Migrate UMC-Webserver to Python 3
Comment 2 Dirk Wiesenthal univentionstaff 2020-06-11 17:18:30 CEST
OK: python2 version still works
OK: no code that would break python3
OK: no switch to python3, still runs as python2
OK: advisory
Comment 3 Erik Damrose univentionstaff 2020-06-17 15:39:26 CEST
<http://errata.software-univention.de/ucs/4.4/626.html>