Bug 37457

Summary: python-notifier crash
Product: UCS Reporter: Florian Best <best>
Component: Upstream packagesAssignee: Florian Best <best>
Status: CLOSED FIXED QA Contact: Alexander Kläser <klaeser>
Severity: normal    
Priority: P5 CC: gohmann, hahn, schwardt, walkenhorst
Version: UCS 3.2Flags: best: Patch_Available+
Target Milestone: UCS 4.0-1-errata   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=37453
https://forge.univention.org/bugzilla/show_bug.cgi?id=37937
What kind of report is it?: --- 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): Error handling, External feedback
Max CVSS v3 score:

Description Florian Best univentionstaff 2015-01-06 14:24:31 CET
Trying to fix some other bug by using some python-notifier methods causes me to not being able to fix it this way because there the next error occurs:

19.12.14 18:45:09.545  MAIN        ( ERROR   ) : Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 210, in <module>
    umc_daemon.do_action()
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/sbin/univention-management-console-server", line 142, in _restart
    self._start()
  File "/usr/lib/pymodules/python2.7/daemon/runner.py", line 131, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 192, in run
    notifier.loop()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 284, in loop
    step()
  File "/usr/lib/pymodules/python2.7/notifier/nf_generic.py", line 271, in step
    not __sockets[ cond ][ fd ]( sock_obj ):
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 144, in _receive
    self._cleanup(socket)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/server.py", line 351, in _cleanup
    self.__states[socket].__del__()
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 123, in __del__
    self.processor.__del__()
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 279, in __del__
    process.__del__()
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 183, in __del__
    self.__process.stop()
  File "/usr/lib/pymodules/python2.7/notifier/popen.py", line 211, in stop
    cb = Callback( self.__kill, 15 )
NameError: global name 'Callback' is not defined

pyflakes popen.py 
popen.py:35: 'types' imported but unused
popen.py:211: undefined name 'Callback'
popen.py:229: undefined name 'Callback'
popen.py:231: undefined name 'Callback'
popen.py:273: undefined name 'Callback'

Patch is here, (pull request sent upstream):
https://github.com/spaceone/python-notifier/commit/31f6fb21c84395c4f31d8147c323ac23ea758a4c
Comment 1 Florian Best univentionstaff 2015-02-09 11:09:30 CET
The UMC-server crash also happened to me in the productive environment now. I did not have much memory in the VM, the garbage collection of the UMC-server triggered this error then.
Comment 2 Philipp Hahn univentionstaff 2015-03-03 15:40:20 CET
Happened again on xen12 - same traceback as in comment 0
Comment 3 Florian Best univentionstaff 2015-04-09 09:13:25 CEST
This was reported in http://forum.univention.de/viewtopic.php?f=56&t=3890&p=14000 with a different traceback:

  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 833, in _mod_connect
    _send_error()
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 825, in _send_error
    self.__processes[mod.name].__del__()
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.py", line 165, in __del__
    self.__process.stop()

This happens when the UMC-server can't connect to the module process after 200 connection attempts (10 seconds).
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2015-04-21 11:38:39 CEST
Seen this now 3 times in conjunction with docker containers.
Comment 5 Janis Meybohm univentionstaff 2015-05-04 10:51:59 CEST
(In reply to Florian Best from comment #3)
> This was reported in
> http://forum.univention.de/viewtopic.php?f=56&t=3890&p=14000 with a
> different traceback:
> 
>   File
> "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.
> py", line 833, in _mod_connect
>     _send_error()
>   File
> "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.
> py", line 825, in _send_error
>     self.__processes[mod.name].__del__()
>   File
> "/usr/lib/pymodules/python2.7/univention/management/console/protocol/session.
> py", line 165, in __del__
>     self.__process.stop()
> 
> This happens when the UMC-server can't connect to the module process after
> 200 connection attempts (10 seconds).

customer reported that one via Ticket#2015050421000041
Comment 6 Florian Best univentionstaff 2015-05-05 18:20:34 CEST
python-notifier has been added to our svn in ucs-4.0/ucs-4.0-1/management/python-notifier to easier maintain it. All current patches from dev/patches and github are integrated there.
The debian/control file has been converted to UTF-8.

YAML: 2015-05-05-python-notifier.yaml

Package has been build:
Package: python-notifier
Version: 0.9.7-2.28.201505051806
Branch: ucs_4.0-0
Scope: errata4.0-1

I could not get dh_python2 working, so it uses still pysupport.
Comment 7 Florian Best univentionstaff 2015-05-05 18:25:12 CEST
*** Bug 37937 has been marked as a duplicate of this bug. ***
Comment 8 Alexander Kläser univentionstaff 2015-05-06 19:27:01 CEST
I could reproduce the traceback from comment 3 which worked fine with the latest python-notifier package. Otherwise the diff with crunchy's latest version looks fine. I only spotted a missing adaptation for the current python-notifier version in notifier/version.py.
Comment 9 Florian Best univentionstaff 2015-05-06 19:37:41 CEST
I cherry-picked that commit. svn r60491.#
Package: python-notifier
Version: 0.9.7-3.29.201505061934
Comment 10 Alexander Kläser univentionstaff 2015-05-06 20:02:30 CEST
Changes: OK
YAML file: OK

→ VERIFIED
Comment 11 Janek Walkenhorst univentionstaff 2015-05-07 17:41:23 CEST
<http://errata.univention.de/ucs/4.0/188.html>