Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1462671 - [rpm-python] rpm._rpms: undefined symbol: spec_Type on Fedora 26
Summary: [rpm-python] rpm._rpms: undefined symbol: spec_Type on Fedora 26
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1457297 (view as bug list)
Depends On: 1393659
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-19 08:52 UTC by Vendula Poncova
Modified: 2017-09-03 04:23 UTC (History)
14 users (show)

Fixed In Version: rpm-4.13.0.1-5.fc26 rpm-4.13.0.1-2.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1393659
Environment:
Last Closed: 2017-09-03 04:23:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vendula Poncova 2017-06-19 08:52:37 UTC
+++ This bug was initially created as a clone of Bug #1393659 +++

Description of problem:
rpm.addSign and rpm.delSign are not available in Fedora 24's rpm python modules (py2 or py3) due to an undefined symbol.  The rpm module's __init__.py file attempts to import addSign and delSign from rpm._rpms [1], but is wrapped in a try/except to ignore import errors, which results in the methods just not being available.  For reference, on EL7 those methods are successfully imported and are usable.

Version-Release number of selected component (if applicable):
rpm-4.13.0-0.rc1.27.fc24.x86_64
rpm-python-4.13.0-0.rc1.27.fc24.x86_64
rpm-python3-4.13.0-0.rc1.27.fc24.x86_64

How reproducible:
This can be observed in both py2 and py3 by running the same import as the rpm modules's __init__.py file [1] outside of a try/except block.

Actual results:
# python2 -c 'from rpm._rpms import *'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/lib64/python2.7/site-packages/rpm/_rpms.so: undefined symbol: spec_Type
# python3 -c 'from rpm._rpms import *'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/lib64/python3.5/site-packages/rpm/_rpms.cpython-35m-x86_64-linux-gnu.so: undefined symbol: spec_Type

Expected results:
# python2 -c 'from rpm._rpms import *'
(successfully imported, no output)

Additional info:
[1]: https://github.com/rpm-software-management/rpm/blob/rpm-4.13.0-rc1/python/rpm/__init__.py#L55-L59

--- Additional comment from Igor Gnatenko on 2016-11-10 01:52:59 EST ---

Confirm this bug on rawhide.

--- Additional comment from Panu Matilainen on 2016-11-10 05:14:38 EST ---

Yup, fixed upstream for some time, 4.13.1 material certainly:
https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d

--- Additional comment from Carl George on 2016-11-10 10:20:08 EST ---

That is odd, because that typo exists on EL7 as well, but everything works fine there.

# yumdownloader --source rpm
# rpm -i rpm-4.11.3-21.el7.src.rpm
# cd rpmbuild/SOURCES
# tar -xf rpm-4.11.3.tar.bz2
# grep -A6 rpm\._rpms rpm-4.11.3/python/setup.py.in
rpmsign_mod = Extension('rpm._rpms',
                   sources = ['rpmbmodule.c'],
                   include_dirs = pkgconfig('--cflags'),
                   libraries = pkgconfig('--libs') + ['rpmsign'],
                   extra_compile_args = cflags,
                   extra_link_args = additional_link_args
                  )
# rpm -q rpm
rpm-4.11.3-21.el7.x86_64
# python -c 'from rpm._rpms import *'
#

--- Additional comment from Igor Gnatenko on 2016-11-10 11:26:47 EST ---

(In reply to Panu Matilainen from comment #2)
> Yup, fixed upstream for some time, 4.13.1 material certainly:
> https://github.com/rpm-software-management/rpm/commit/
> eb632e5158fa4ef993b0e5df2a354f0be7a7a71d
I think it's different thing.

--- Additional comment from Panu Matilainen on 2016-11-11 02:15:12 EST ---

In EL7 setup.py is not used for compiling the shipped python bindings.

It *could* be something else too but I don't see what that would be.

--- Additional comment from Carl George on 2016-12-01 13:34:56 EST ---

Can https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d be backported as a patch for Fedora 24 and/or 25?

--- Additional comment from Carl George on 2017-01-23 15:52:13 EST ---

I'm currently using rpm.addSign with Python 2 on EL7, but I would like to migrate to Python 3 on Fedora.  This bug is preventing me from doing so.  Can anyone comment on whether 4.13.1 is due to be released soon, or if that fix can be backported to Fedora 25?

--- Additional comment from Carl George on 2017-04-14 12:04:49 EDT ---

This is broken in all current Fedora releases.  Please backport that commit in order to fix it.

--- Additional comment from Vendula Poncova on 2017-05-19 08:58:30 EDT ---

We get a similar error on Fedora Rawhide when we run pylint:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/astroid/manager.py", line 129, in ast_from_module_name
    module = modutils.load_module_from_name(modname)
  File "/usr/lib/python3.6/site-packages/astroid/modutils.py", line 190, in load_module_from_name
    return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
  File "/usr/lib/python3.6/site-packages/astroid/modutils.py", line 233, in load_module_from_modpath
    module = imp.load_module(curname, mp_file, mp_filename, mp_desc)
  File "/usr/lib64/python3.6/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib64/python3.6/imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 675, in _load
  File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: /usr/lib64/python3.6/site-packages/rpm/_rpms.cpython-36m-x86_64-linux-gnu.so: undefined symbol: spec_Type

--- Additional comment from Carl George on 2017-05-22 10:17:52 EDT ---

I tested out adding https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d as a patch in COPR https://copr.fedorainfracloud.org/coprs/carlgeorge/rpm-rhbz1393659/ for Fedora 25.  It worked as expected.  Please add the patch.

--- Additional comment from Carl George on 2017-05-22 10:19 EDT ---



--- Additional comment from Vendula Poncova on 2017-05-22 12:08:56 EDT ---

This bug breaks anaconda tests for rawhide, so setting as a test blocker.

--- Additional comment from Panu Matilainen on 2017-05-23 01:44:23 EDT ---

What on earth is anaconda doing with rpm's signing module?

--- Additional comment from Panu Matilainen on 2017-05-23 05:07:32 EDT ---

Anyway... fixed in rpm-4.13.0.1-21.fc27

--- Additional comment from Vendula Poncova on 2017-05-23 08:59:25 EDT ---

In our tests, we run pylint on anaconda and pylint fails to analyse code that imports rpm (see comment 9). Thank you!

--- Additional comment from Carl George on 2017-05-23 09:05:34 EDT ---

This is broken in F26, F25, and F24 as well.  Can it please be fixed in more than just Rawhide?

--- Additional comment from Vendula Poncova on 2017-06-12 08:56:36 EDT ---

Hi, this bug now breaks anaconda tests on Fedora 26. Could you please fix it as well?

Comment 1 Fedora Update System 2017-06-27 08:37:42 UTC
rpm-4.13.0.1-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-2128524184

Comment 2 Fedora Update System 2017-06-27 20:26:47 UTC
rpm-4.13.0.1-5.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-2128524184

Comment 3 Charalampos Stratakis 2017-06-28 13:02:00 UTC
*** Bug 1457297 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2017-07-07 23:01:37 UTC
rpm-4.13.0.1-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2017-08-16 13:31:21 UTC
rpm-4.13.0.1-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-e9a1ddb533

Comment 6 Fedora Update System 2017-08-18 21:53:33 UTC
rpm-4.13.0.1-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-e9a1ddb533

Comment 7 Fedora Update System 2017-09-03 04:23:24 UTC
rpm-4.13.0.1-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.