RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1965147 - Errors are reported when using virt-v2v to convert SUSE Linux Enterprise Server 11 SP4 guest
Summary: Errors are reported when using virt-v2v to convert SUSE Linux Enterprise Serv...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rpm
Version: 9.0
Hardware: x86_64
OS: Linux
high
low
Target Milestone: rc
: 9.0 Beta
Assignee: Michal Domonkos
QA Contact: Tomáš Bajer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-27 02:00 UTC by xinyli
Modified: 2022-05-17 16:35 UTC (History)
11 users (show)

Fixed In Version: rpm-4.16.1.3-9.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 16:01:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
v2v execution log (213.67 KB, text/plain)
2021-05-27 02:00 UTC, xinyli
no flags Details
bz1965147-rpmdb.tar.xz (10.74 MB, application/x-xz)
2021-05-27 13:00 UTC, Richard W.M. Jones
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm pull 1699 0 None open Support hash v8 databases from BDB < 4.6 in bdb_ro 2021-06-10 08:31:38 UTC
Red Hat Product Errata RHBA-2022:4021 0 None None None 2022-05-17 16:01:36 UTC

Description xinyli 2021-05-27 02:00:20 UTC
Created attachment 1787410 [details]
v2v execution log

Description of problem:
virt-v2v can't convert sles11sp4 guest on rhel9

Version-Release number of selected component (if applicable):
virt-v2v-1.44.0-1.el9.1.x86_64

libguestfs-1.45.5-1.el9.x86_64

libvirt-7.0.0-6.el9.x86_64

qemu-kvm-6.0.0-1.el9.x86_64

nbdkit-1.25.7-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Use virt-v2v to convert SUSE Linux Enterprise Server 11 SP4 from vmware esxi to rhv.
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk6.5 -io  vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  esx6.7-sles11sp4-x86_64 -ip /home/passwd  -o rhv-upload -of qcow2 -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt
[   0.6] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-sles11sp4-x86_64 -it vddk  -io vddk-libdir=/home/vddk6.5 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   2.4] Creating an overlay to protect the source from being modified
[   3.4] Opening the overlay
[   9.5] Inspecting the overlay
[  12.2] Checking for sufficient free disk space in the guest
[  12.2] Estimating space required on target for each disk
[  12.2] Converting SUSE Linux Enterprise Server 11 SP4 to run on KVM
virt-v2v: error: no installed kernel packages were found.

This probably indicates that virt-v2v was unable to inspect this guest 
properly.

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Actual results:
as above description

Expected results:
Conversion could be finished without error.

Additional info:
Other sles guests can be successfully converted in RHEL9,such as sless12sp4, sles15, opensuse42.3,opensuse15.
The issue cannot be reproduced in RHEL8.5 AV:
virt-v2v-1.42.0-12.module+el8.5.0+10976+d40a93e9.x86_64
libguestfs-1.44.0-3.module+el8.5.0+10681+17a9b157.x86_64
qemu-kvm-6.0.0-16.module+el8.5.0+10848+2dccc46d.x86_64
nbdkit-1.24.0-1.module+el8.4.0+9341+96cf2672.x86_64
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk6.5 -io  vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  esx6.7-sles11sp4-x86_64 -ip /home/passwd  -o rhv-upload -of qcow2 -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt
[   0.6] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-sles11sp4-x86_64 -it vddk  -io vddk-libdir=/home/vddk6.5 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   2.4] Creating an overlay to protect the source from being modified
[   5.6] Opening the overlay
[  13.1] Inspecting the overlay
[  24.8] Checking for sufficient free disk space in the guest
[  24.8] Estimating space required on target for each disk
[  24.8] Converting SUSE Linux Enterprise Server 11 SP4 to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  57.8] Mapping filesystem data to avoid copying unused and blank areas
[  60.8] Closing the overlay
[  61.1] Assigning disks to buses
[  61.1] Checking if the guest needs BIOS or UEFI to boot
[  61.1] Initializing the target -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd -os nfs_data
[  62.4] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/tmp/v2vnbdkit.sCcfMz/nbdkit4.sock", "file.export": "/" } (qcow2)
    (100.00/100%)
[ 793.6] Creating output metadata
[ 795.5] Finishing off

Comment 1 Richard W.M. Jones 2021-05-27 11:56:27 UTC
The problem is that for this guest inspect_list_applications2
returns an empty list in RHEL 9 (but returns correctly in RHEL 8).
Because virt-v2v believes there are no kernel packages installed,
the conversion fails immediately.

The problem specifically happens because librpm in RHEL 9
does not understand the RPM database in this SLES 11 guest.  It
gives these errors:

guestfsd: <= internal_list_rpm_applications (0x1fe) request length 40 bytes
command: mount returned 0
chroot: /sysroot: running 'librpm'
warning: could not open /var/lib/rpm/Obsoletename: No such file or directory
warning: could not open /var/lib/rpm/Filetriggername: No such file or directory
warning: could not open /var/lib/rpm/Transfiletriggername: No such file or directory
warning: could not open /var/lib/rpm/Recommendname: No such file or directory
warning: could not open /var/lib/rpm/Suggestname: No such file or directory
warning: could not open /var/lib/rpm/Supplementname: No such file or directory
warning: could not open /var/lib/rpm/Enhancename: No such file or directory
error: bdb_ro error reading Name database
error: bdb_ro error reading Packages database
librpm returned 0 installed packages
guestfsd: => internal_list_rpm_applications (0x1fe) took 0.16 secs
libguestfs: trace: v2v: internal_list_rpm_applications = <struct guestfs_application2_list(0)>
libguestfs: trace: v2v: inspect_list_applications2 = <struct guestfs_application2_list(0)>

Note that in RHEL 8 we used to parse the RPM DB directly, librpm
was not involved, so I don't know if this is a regression in librpm.

Comment 2 Panu Matilainen 2021-05-27 12:03:53 UTC
Can you attach a tarball of the failing rpmdb for inspection? The bdb_ro backend is new and not so widely tested in real world, it's not a huge surprise if there are some bugs left.

Comment 3 Richard W.M. Jones 2021-05-27 12:33:33 UTC
This is not a fix, but I've added a better error message upstream:
https://github.com/libguestfs/virt-v2v/commit/6f9fc0992555fab0f614940826bec1b8ff9a65b7

Comment 5 Richard W.M. Jones 2021-05-27 13:00:36 UTC
Created attachment 1787621 [details]
bz1965147-rpmdb.tar.xz

Comment 6 Panu Matilainen 2021-05-27 13:44:52 UTC
ACK, easily reproduced with that, thanks. 

My first educated guess is that bdb_ro is not correctly handling BDB hash version 8, as running db_upgrade on the files (which updates them to hash 9) makes them readable by bdb_ro. Reassigning to rpm.

Comment 7 Panu Matilainen 2021-06-10 08:31:39 UTC
Proposed fix in https://github.com/rpm-software-management/rpm/pull/1699

Comment 8 Panu Matilainen 2021-06-23 12:29:33 UTC
FYI, the above fix landed in Fedora rawhide today (rpm >= 4.17.0 beta1) if you want to test it.

Comment 11 Richard W.M. Jones 2021-09-14 10:56:20 UTC
(In reply to Panu Matilainen from comment #8)
> FYI, the above fix landed in Fedora rawhide today (rpm >= 4.17.0 beta1) if
> you want to test it.

Sorry, realised that I didn't get around to testing this :-(

Using: rpm-4.17.0-1.fc36.x86_64 and the guest from comment 4
("SUSE Linux Enterprise Server 11 SP4"):

$ virt-inspector --format=raw -a nbd://localhost

The output was too long for me to paste here, but it includes
the expected set of <application> elements, indicating that the
new version of RPM is working great.

Comment 15 Richard W.M. Jones 2021-12-14 12:47:56 UTC
From our point of view the warnings do not matter.  They will be
converted to libguestfs debug output and hidden away for most users
or available for those who enable debugging.  Please don't hold up
this change because of a warning.

Comment 25 errata-xmlrpc 2022-05-17 16:01:23 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 (new packages: rpm), 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/RHBA-2022:4021


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