M2Crypto installed with VirtualEnv/PIP broken

Bug #892271 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Adrian Smith

Bug Description

Fresh Nova test run on Oneiric, using virtualenv:

======================================================================
ERROR: <nose.suite.ContextSuite context=nova.tests>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/nose/suite.py", line 208, in run
    self.setUp()
  File "/home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/jpipes/repos/nova/nova/tests/__init__.py", line 48, in setup
    from nova.tests import fake_flags
  File "/home/jpipes/repos/nova/nova/tests/fake_flags.py", line 27, in <module>
    flags.DECLARE('auth_driver', 'nova.auth.manager')
  File "/home/jpipes/repos/nova/nova/flags.py", line 276, in DECLARE
    __import__(module_string, globals(), locals())
  File "/home/jpipes/repos/nova/nova/auth/manager.py", line 34, in <module>
    from nova import crypto
  File "/home/jpipes/repos/nova/nova/crypto.py", line 36, in <module>
    import M2Crypto
  File "/home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/M2Crypto/__init__.py", line 22, in <module>
    import __m2crypto
ImportError: /home/jpipes/repos/nova/.nova-venv/local/lib/python2.7/site-packages/M2Crypto/__m2crypto.so: undefined symbol: SSLv2_method

I believe this is related to this Debian bug:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637904

Maybe we need to specify version of M2Crypto in the pip-requires file?

Revision history for this message
Mark McLoughlin (markmc) wrote :

FWIW, on Fedora, 'pip install M2Crypto' doesn't work at all (not even for 0.20.1 or 0.20.2), so we just use the system M2Crypto package rather than installing it into venv. See the code in install_venv.py

The issue on Fedora is:

    swig -python -I/usr/include/python2.7 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
    /usr/include/openssl/opensslconf.h:31: Error: CPP #error ""This openssl-devel package does not work your architecture?"". Use the -cpperraswarn option to continue swig processing.
    error: command 'swig' failed with exit status 1

See also:

  http://stackoverflow.com/questions/7772965/m2crypto-doesnt-install-in-venv-or-swig-doesnt-define-x86-64-which-breaks
  https://bugzilla.redhat.com/456764

A sorry tale of fail

Revision history for this message
Mark McLoughlin (markmc) wrote :
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hmm, a sorry tale of fail indeed...

Mark, any chance you feel like porting your Fedora work to Glance's install_venv.sh?

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/2112
Committed: http://github.com/openstack/nova/commit/dbbd6cf1079ef46de3e9ec11db0eb824a3875099
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit dbbd6cf1079ef46de3e9ec11db0eb824a3875099
Author: Adrian Smith <email address hidden>
Date: Mon Nov 28 21:24:47 2011 +0000

    Use system M2Crypto package on Oneiric, bug 892271

    Ubuntu Oneiric has a problem with the pip installed version of m2crypto.
    This fix installs python-m2crypto via apt-get on Oneiric.

    Change-Id: I8290a74b614eb0d0b8d620dbad19d2cc6843de8b

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Adrian Smith (adriansmith)
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.