Bug 13143 - [2.6.1 rc1] bitbake core-image-minimal failed because no module named 'gpg' on CentOS 7 and OpenSuse 42.3
Summary: [2.6.1 rc1] bitbake core-image-minimal failed because no module named 'gpg' o...
Status: RESOLVED FIXED
Alias: None
Product: Functional (self) Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 2.6.1
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.6.2
Assignee: Anuj Mittal
QA Contact: Mohamad Noor Alim
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-01-17 07:37 UTC by Mohamad Noor Alim
Modified: 2019-02-27 03:04 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mohamad Noor Alim 2019-01-17 07:37:13 UTC
Building core-image-minimal failed as no module named 'gpg'. Most of test cases such as imagefeatures, runqemu, wic, runtime_test and buildoptions failed due to this issue. 
Following is a log from autobuilder.

NOTE: Running task 2191 of 2428 (/home/user/yocto-worker/oe-selftest/build/meta/recipes-core/images/core-image-minimal.bb:do_rootfs)
NOTE: recipe core-image-minimal-1.0-r0: task do_rootfs: Started
ERROR: core-image-minimal-1.0-r0 do_rootfs: Could not invoke dnf. Command '/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=debug -y -c /home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/etc/yum.repos.d --repofrompath=oe-repo,/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/oe-rootfs-repo --installroot=/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs --setopt=logdir=/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/temp makecache --refresh' returned 1:
Traceback (most recent call last):
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/bin/dnf.real", line 57, in <module>
    from dnf.cli import main
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/base.py", line 29, in <module>
    from dnf.yum import history
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/yum/history.py", line 28, in <module>
    from . import misc as misc
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/yum/misc.py", line 30, in <module>
    import dnf.crypto
  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/crypto.py", line 29, in <module>
    import gpg
ImportError: No module named 'gpg'
Comment 1 Ross Burton 2019-01-17 11:38:42 UTC
Can you reproduce this outside of the autobuilder?
Comment 2 Richard Purdie 2019-01-17 15:41:45 UTC
We're going to need help to looking into this from people with access to these machines as we aren't seeing this on the public centos or suse autobuilders. Any idea on what the differences may be or how to reproduce?
Comment 3 Mohamad Noor Alim 2019-01-18 01:52:39 UTC
To reproduce this issue. Use machine with centos 7 or opensuse 42.3
1. clone poky
   $ git clone git://git.yoctoproject.org/poky
   $ cd poky; git checkout 1cab405d88149fd63322a867c6adb4a80ba68db3
2. run oe-selftest specifically on wic test cases.
   $ source oe-init-build-env
   $ oe-selftest -r wic.Wic -j 15


NOTE: if we try to build core-image-minimal, bitbake will complain gpg module not exist. Should we install gpg python package on host machine?
Comment 4 Richard Purdie 2019-01-22 15:40:22 UTC
Could you retest with the HEAD of the thud branch please? This may be something which has been fixed in the QA changes later in that branch which were not included in 2.6.1 rc1.
Comment 5 Armin Kuster 2019-01-22 16:55:30 UTC
(In reply to comment #4)
> Could you retest with the HEAD of the thud branch please? This may be
> something which has been fixed in the QA changes later in that branch which
> were not included in 2.6.1 rc1.

The commit I think that should have addressed this went in 12 Dec and is included in the commit being checkout out.

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=thud&id=920a95e42475d5d4733b1afab03514c000a37e42
Comment 6 Mohamad Noor Alim 2019-01-23 08:43:54 UTC
I retest on thud HEAD, 7022689b109a7e2bb52c76a46d76fd3760658ad0. The result same as reported with no module name 'gpg' on both CentOS 7 and opensuse 42.3. I also retest on Ubuntu 18.04 and Fedora 26 but both distos passed. What is missing here?
Comment 7 Richard Purdie 2019-01-24 16:59:17 UTC
I keep getting confused between "gpg not found" as in the binary executable and "import gpg failed" as in the python module is missing.

The former was fixed by some changes we made but you're seeing you're seeing the latter case. dnf is configured to unconditionally depend on gpg so it should always be present. There should be no need to install gpg on the host system and even if you did, that wouldn't give a python module our python-native could use (since that uses gpg-native, not gpg from the host).

When an error like "  File "/home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/crypto.py", line 29, in <module>
    import gpg"

occurs, it would be useful to know if there is any gpg* files in /home/user/yocto-worker/oe-selftest/build/build-st-37375/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native.

The build logs for dnf-native would also be useful to see if gpg was enabled.

I think someone with access to these autobuilders may need to help debug this unfortunately. Ross or Anuj maybe?
Comment 8 Anuj Mittal 2019-02-01 13:08:41 UTC
I think the problem is that gpgme-native is installing the module in wrong directory. Configure scripts detects the host version of python and installs the module in (in this case) ... /python3.4/site-packages/

Probably works on public autobuilder because host python is also 3.5?
Comment 9 Mohamad Noor Alim 2019-02-27 01:51:21 UTC
Close the ticket as I did not see the gpg issue on latest thud branch head with commit id b904775c2b82f110a9e0ae9281be452546916fea.
Comment 10 Armin Kuster 2019-02-27 03:04:01 UTC
thanks