Bug 1828681

Summary: Unable to initialize gcrypt will prevent qemu related commands from running
Product: Red Hat Enterprise Linux 8 Reporter: Yihuang Yu <yihyu>
Component: qemu-kvmAssignee: Danilo de Paula <ddepaula>
qemu-kvm sub component: General QA Contact: Xueqiang Wei <xuwei>
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: urgent CC: coli, ddepaula, jen, jinzhao, juzhang, ldoktor, pablo.iranzo, qzhang, rjones, smitterl, virt-maint, weizhan, xfu, xujin, yfu, ymankad, zhenyzha
Version: 8.3Keywords: Regression, TestBlocker
Target Milestone: rc   
Target Release: 8.3   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1839916 (view as bug list) Environment:
Last Closed: 2020-11-04 02:53:06 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:
Bug Depends On: 1762765    
Bug Blocks: 1831748, 1839916    

Description Yihuang Yu 2020-04-28 06:22:54 UTC
Description of problem:
Failed to create a image via "qemu-img create"

Version-Release number of selected component (if applicable):
qemu-img: qemu-img-4.2.0-19.module+el8.3.0+6423+e4cb6418.ppc64le
kernel: 4.18.0-193.13.el8.ppc64le

How reproducible:
always

Steps to Reproduce:
1. Create a qcow2 image
# qemu-img create -f qcow2 test.qcow2 10G
qemu-img: Unable to initialize gcrypt

2. Create a raw image
# qemu-img create -f raw  test.raw 10G
qemu-img: Unable to initialize gcrypt

3.

Actual results:
Failed to create image

Expected results:
Can successfully create a image

Additional info:

Comment 1 Yihuang Yu 2020-04-28 06:40:21 UTC
I can confirm that my system has installed the libgcrypt package.

# rpm -qa | grep libgcrypt
libgcrypt-1.8.3-4.el8.ppc64le
libgcrypt-devel-1.8.3-4.el8.ppc64le

And this problem will block all qemu test.

# /usr/libexec/qemu-kvm 
qemu-kvm: cannot initialize crypto: Unable to initialize gcrypt

Comment 2 Xueqiang Wei 2020-04-28 07:54:47 UTC
Tested with qemu-kvm-5.0.0-0.scrmod+el8.3.0+6399+84188c13.wrb200422, not hit this issue.


# qemu-img create -f qcow2 test.qcow2 10G
Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16

# qemu-img create -f raw  test.raw 10G
Formatting 'test.raw', fmt=raw size=10737418240

# qemu-img info test.qcow2 
image: test.qcow2
file format: qcow2
virtual size: 10 GiB (10737418240 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

# qemu-img info test.raw 
image: test.raw
file format: raw
virtual size: 10 GiB (10737418240 bytes)
disk size: 4 KiB

Comment 3 Xueqiang Wei 2020-04-28 08:19:38 UTC
Tested with qemu-img-4.2.0-19.module+el8.3.0+6423+e4cb6418.x86_64, hit this issue. And also can not query qemu version.

kernel-4.18.0-193.el8.x86_64
qemu-kvm-4.2.0-19.module+el8.3.0+6423+e4cb6418.x86_64
qemu-img-4.2.0-19.module+el8.3.0+6423+e4cb6418.x86_64


# qemu-img create -f qcow2 test.qcow2 10G
qemu-img: Unable to initialize gcrypt

# qemu-img create -f raw  test.raw 10G
qemu-img: Unable to initialize gcrypt

# rpm -qa|grep gcrypt
libgcrypt-1.8.3-4.el8.x86_64


# /usr/libexec/qemu-kvm -version
qemu-kvm: cannot initialize crypto: Unable to initialize gcrypt

Comment 4 Yanan Fu 2020-04-28 08:22:22 UTC
Hi Yash,

I would like to highlight this issue.
It is a regression issue with RHEL8.3.0 slow train, which block the gating test now.
Thanks!


Best regards
Yanan Fu

Comment 5 Yihuang Yu 2020-04-29 03:24:03 UTC
A highlight is that libgcrypt provided by RHEL-8.3.0 needs to be updated. This problem depends on bug 1762765

After upgrade the libgcrypt package, qemu can work.

# rpm -qa | grep libgcrypt
libgcrypt-1.8.5-3.el8.ppc64le
libgcrypt-devel-1.8.5-3.el8.ppc64le

I think we might be able to move it to TestOnly.

Comment 6 Yash Mankad 2020-04-29 05:07:00 UTC
(In reply to Yanan Fu from comment #4)
> Hi Yash,
> 
> I would like to highlight this issue.
> It is a regression issue with RHEL8.3.0 slow train, which block the gating
> test now.
> Thanks!
> 
> 
> Best regards
> Yanan Fu

Hi Yanan,

Can you try again with Yihuang's suggestion of using libgcrypt-1.8.5-3 ?
I will get someone from our team to have a look at the QEMU side as well.

Comment 7 Yanan Fu 2020-04-29 06:02:26 UTC
(In reply to Yash Mankad from comment #6)

> Hi Yanan,
> 
> Can you try again with Yihuang's suggestion of using libgcrypt-1.8.5-3 ?
> I will get someone from our team to have a look at the QEMU side as well.

Hi Yash,

Yes, libgcrypt-1.8.5-3 can work.

# rpm -qa | grep gcrypt
libgcrypt-1.8.5-3.el8.x86_64
# qemu-img create -f qcow2 test.qcow2 10G
Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16

Comment 8 Danilo de Paula 2020-04-29 15:05:19 UTC
The fix appears to be included in the libgcrypt nightly. I triggered a new build.

Comment 9 Jeff Nelson 2020-04-29 22:19:49 UTC
Setting testonly keyword and assigning to maintainer. If the new build works, then please move to ON_QA.

Comment 10 Yanan Fu 2020-04-30 03:50:58 UTC
After RHEL.8.3 BaseOs 'RHEL-8.3.0-20200428.n.0', libgcrypt version already be updated from libgcrypt-1.8.3-4 to '1.8.5.2'.
This issue gone.

Comment 12 Xueqiang Wei 2020-05-05 09:57:42 UTC
Tested with qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135, not hit this issue. So set bug status to VERIFIED. If I was wrong, please correct me.

versions:
kernel-4.18.0-194.el8.x86_64
qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135
qemu-img-4.2.0-19.module+el8.3.0+6473+93e27135
libgcrypt-1.8.5-3.el8.x86_64


# /usr/libexec/qemu-kvm -version
QEMU emulator version 4.2.0 (qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135)

# qemu-img create -f qcow2 test.qcow2 10G
Formatting 'test.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16

# qemu-img info test.qcow2 
image: test.qcow2
file format: qcow2
virtual size: 10 GiB (10737418240 bytes)
disk size: 196 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

# qemu-img create -f raw test.raw 10G
Formatting 'test.raw', fmt=raw size=10737418240

# qemu-img info test.raw 
image: test.raw
file format: raw
virtual size: 10 GiB (10737418240 bytes)
disk size: 4 KiB

# qemu-img create -f luks --object secret,id=sec0,data=redhat  -o key-secret=sec0  base.luks 1G
Formatting 'base.luks', fmt=luks size=1073741824 key-secret=sec0

# qemu-img info base.luks 
image: base.luks
file format: luks
virtual size: 1 GiB (1073741824 bytes)
disk size: 256 KiB
encrypted: yes
Format specific information:
    ivgen alg: plain64
    hash alg: sha256
    cipher alg: aes-256
    uuid: d30696ce-e6ee-42f7-bff7-afeea108bb6c
    cipher mode: xts
    slots:
        [0]:
            active: true
            iters: 1025602
            key offset: 4096
            stripes: 4000
        [1]:
            active: false
            key offset: 262144
        [2]:
            active: false
            key offset: 520192
        [3]:
            active: false
            key offset: 778240
        [4]:
            active: false
            key offset: 1036288
        [5]:
            active: false
            key offset: 1294336
        [6]:
            active: false
            key offset: 1552384
        [7]:
            active: false
            key offset: 1810432
    payload offset: 2068480
    master key iters: 205793

Comment 13 Richard W.M. Jones 2020-05-27 13:02:52 UTC
I'm not sure I agree with the resolution of this bug.  Please see:
https://bugzilla.redhat.com/show_bug.cgi?id=1840485#c1
https://lists.nongnu.org/archive/html/qemu-devel/2020-05/threads.html#07609

Comment 16 errata-xmlrpc 2020-11-04 02:53:06 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 (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2020:4676

Comment 17 Richard W.M. Jones 2021-02-08 09:39:59 UTC
*** Bug 1925029 has been marked as a duplicate of this bug. ***