Bug 866508

Summary: Fail to import libvirt python module due to 'undefined symbol: libssh2_agent_free'
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.5CC: acathrow, dyasny, dyuan, mzhan, pkrempa, whuang
Target Milestone: rcKeywords: TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-4.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:10:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Jia 2012-10-15 14:19:52 UTC
Description of problem:
Fail to import libvirt python module due to 'undefined symbol: libssh2_agent_free'.

Version-Release number of selected component (if applicable):
# rpm -q libvirt-python
libvirt-python-0.10.2-3.el6.x86_64

How reproducible:
always

Steps to Reproduce:
# python
Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
  
Actual results:

>>> import libvirt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 25, in <module>
    raise lib_e
ImportError: /usr/lib64/libvirt.so.0: undefined symbol: libssh2_agent_free


Expected results:
Can successfully import libvirt python module.

Additional info:

Comment 3 Peter Krempa 2012-10-16 00:03:23 UTC
What version of libssh2 do you have installed?

This issue is reproducible if you upgrade only libvirt and not the whole system. On a up-to-date system libvirt works fine with libssh2. The minimum required version of libssh2 is 1.3.

I will investigate if the spec file is correct or if it requires tweaking.

Comment 4 Alex Jia 2012-10-16 01:23:04 UTC
(In reply to comment #3)
> What version of libssh2 do you have installed?
> 
> This issue is reproducible if you upgrade only libvirt and not the whole
> system. On a up-to-date system libvirt works fine with libssh2. The minimum
> required version of libssh2 is 1.3.
> 
> I will investigate if the spec file is correct or if it requires tweaking.

Hi Peter,
I think you're right, my libssh2 is 1.2.2-7.el6_1.1, it should be the spec file misses package dependency on libssh2-1.3*.

Regards,
Alex

Comment 5 Alex Jia 2012-10-16 02:12:09 UTC
Maybe, the commit 1e25c54 results in this question.

Comment 6 Huang Wenlong 2012-10-16 04:19:45 UTC
*** Bug 866741 has been marked as a duplicate of this bug. ***

Comment 7 Peter Krempa 2012-10-16 07:17:30 UTC
libssh2 isn't exporting versioning symbols, so RPM isn't able to automatically gather the version of libssh2 that is required when built with libssh2 transport.

I'll post a spec file change to add this requirement manually.

Until then the workaround to make libvirt working is to upgrade libssh2 manually.

Comment 8 Peter Krempa 2012-10-16 21:02:57 UTC
Fixed upstream with:

commit cb4f41b8d0a2dc4258f1b097dff2ca2b34fbd086
Author: Peter Krempa <pkrempa>
Date:   Tue Oct 16 14:34:35 2012 +0200

    spec: Add runtime requirement for libssh2
    
    libssh2 unfortunately doesn't support symbol versioning so RPM can't
    figure out what version is needed for the currently installed libvirt
    package. This patch adds a runtime requirement, so that the correct
    version of libssh2 can be installed along with libvirt.

Comment 10 Huang Wenlong 2012-10-17 03:58:09 UTC
Verify this bug : 
libvirt-0.10.2-4.el6.x86_64

check in the spec file 
...
%if %{with_libssh2_transport}
Requires: libssh2 >= 1.3.0
%endif
...

#rpm -q libvirt-client --requires|grep libssh2
libssh2 >= 1.3.0
libssh2.so.1()(64bit)

Comment 11 errata-xmlrpc 2013-02-21 07:10:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html