Bug 40133 - uvmmd-nodes.py throws SystemError: dynamic module not initialized properly
uvmmd-nodes.py throws SystemError: dynamic module not initialized properly
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Virtual machines (UVMM)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.1-0-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks: 40255
  Show dependency treegraph
 
Reported: 2015-11-30 17:21 CET by Janis Meybohm
Modified: 2016-01-13 13:11 CET (History)
5 users (show)

See Also:
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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2015-11-30 17:21:46 CET
Ticket#2015113021000481

UCS 4.0-4 errata363 

listener.log shows (frequently):

30.11.15 11:56:28.524  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/uvmmd-nodes.py failed
Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/uvmmd-nodes.py", line 44, in <module>
    from univention.uvmm.uvmm_ldap import SERVICES, ldap2fqdn
  File "/usr/lib/pymodules/python2.7/univention/uvmm/uvmm_ldap.py", line 46, in <module>
    from helpers import TranslatableException, N_ as _, FQDN as HOST_FQDN
  File "/usr/lib/pymodules/python2.7/univention/uvmm/helpers.py", line 77, in <module>
    import libvirt
  File "/usr/lib/pymodules/python2.7/libvirt.py", line 20, in <module>
    import libvirtmod
SystemError: dynamic module not initialized properly
30.11.15 11:56:28.524  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/uvmmd-nodes.py failed in module_import()
Comment 1 Janis Meybohm univentionstaff 2015-12-01 10:32:14 CET
I've found this trace on two other customer systems as well running UCS 4.0-0 and UCS 4.0-4 amd64 as well as i386 (4.1.0-ucs153-amd64 and 2.6.32-ucs64-amd64).

Reproduction is not possible by simply importing the modules into the python interpreter but only by PyImport_ExecCodeModuleEx in handler.c
Comment 2 Philipp Hahn univentionstaff 2015-12-14 16:04:59 CET
The call to initlibvirtmod() fails, as virGlobalInit() checks for getuid()=0 == geteuid()=100 and aborts.

# python -c 'import pwd,os;os.seteuid(pwd.getpwnam("listener").pw_uid);import libvirt'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/libvirt.py", line 20, in <module>
    import libvirtmod
SystemError: dynamic module not initialized properly

This is so since libvirt-1.2.X.
Comment 3 Philipp Hahn univentionstaff 2015-12-14 16:26:30 CET
(In reply to Philipp Hahn from comment #2)

> This is so since libvirt-1.2.X.

Since v1.1.4 to fix CVE-2013-4400(-3)
Comment 4 Philipp Hahn univentionstaff 2015-12-15 08:37:51 CET
r66332 | Bug #40133 UVMM: Remove unused imports
 Remove unused import of libvirt

Package: univention-virtual-machine-manager-daemon
Version: 5.0.1-8.611.201512150831
Branch: ucs_4.1-0
Scope: errata4.1-0

r66335 | Bug #40133 UVMM: Remove unused imports YAML
 univention-virtual-machine-manager-daemon.yaml
Comment 5 Florian Best univentionstaff 2015-12-17 12:40:25 CET
Fix: OK
YAML: OK
Comment 6 Janek Walkenhorst univentionstaff 2016-01-13 13:11:32 CET
<http://errata.software-univention.de/ucs/4.1/53.html>