Univention Bugzilla – Bug 52686
Python3 UMC Modules don't log anything
Last modified: 2021-05-25 16:02:09 CEST
Created attachment 10603 [details] Workaround-for-python3-umc-module-logging.patch On my UCS 5.0 beta system I have a bunch on UMC modules running, some with python2.7 and some with python3. The ones running with python3 only log exactly one line into their respective log file: DEBUG_INIT The attached patch shows the line that breaks the logging. No clue why.
A quick experiment with "kill -HUP" against the module PID (to trigger log_reopen() in daemon mode) shows another defect of the python3 UMC modules. After receiving this signal the module turns into a fast spinning wheel of fire, eternally logging: =================================================================== 25.01.21 17:57:56.934 MAIN ( ERROR ) : Cannot accept new connection: [Errno 88] Socket operation on non-socket 25.01.21 17:57:56.934 MAIN ( ERROR ) : Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/protocol/server.py", line 402, in _connection socket, addr = socket.accept() File "/usr/lib/python3.7/socket.py", line 212, in accept fd, addr = self._accept() OSError: [Errno 88] Socket operation on non-socket 25.01.21 17:57:56.934 MAIN ( ERROR ) : Cannot accept new connection: [Errno 88] Socket operation on non-socket 25.01.21 17:57:56.934 MAIN ( ERROR ) : Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/protocol/server.py", line 402, in _connection socket, addr = socket.accept() File "/usr/lib/python3.7/socket.py", line 212, in accept fd, addr = self._accept() OSError: [Errno 88] Socket operation on non-socket =================================================================== Note: this was all in the same millisecond.
Created attachment 10604 [details] Workaround-for-python3-umc-module-logging-2.patch Another possible workaround for the original topic. Thanks to Dirk Wiesenthal.
I think we should go with the second patch. Finding the real cause maybe can be done after the release?
I'd be fine with that, but I have no clue if this breaks anything. I guess it will be fine until somebody would actually use the logging of the notifier, but that would be a developer, not a user.
commit a4073d4a3d11fb704e4650cfb35469ca87601828 Bug #52686: fix logging of univention-debug python-notifier opens logging streams during import (instead of during notifier.init(), grr). In combination with python-daemon, these file descriptor (for /var/log/python-notifier.log) are closed during daemonizing. This somehow affects univention.debug when we remove the notifier.log handler before initializing univention.debug. Only in Python 3.
Works for normal logging and tracebacks. Changelog entry not required, interim bug.
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".