Bug 1668378

Summary: Under Microsoft WIndows Subsystem for Linux (WSL) - RPM issues after RPM DB rebuild [rhel7]
Product: Red Hat Enterprise Linux 7 Reporter: James Hartsock <hartsjc>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: pmatilai
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-01 08:11:36 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 James Hartsock 2019-01-22 15:38:44 UTC
Description of problem:
After an RPM database rebuild, like rpm --rebuilddb, commands like rpm & yum fail and/or hang.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.6 (Maipo)

How reproducible:
Very

Steps to Reproduce:
1. Take RHEL 7 container image, export & gzip it
   # podman pull registry.access.redhat.com/rhel7
   # podman run -it rhel7 sleep 99999
   # podman ps
   CONTAINER ID
   <ContainID>
   # podman export <ContainID> -o rhel7.tar
   # podman kill   <ContainID>
   # gzip rhel7.tar

2. Use https://github.com/DDoSolitary/LxRunOffline on Windows setup for WSL.
   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe install -n RHEL7 -d RHEL7 -f rhel7.tar.gz
   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe set-default -n RHEL7
   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe get-default
   RHEL7

3. yum/rpm comamands work, even able to install.

4. Rebuild rpmdb and first command fails, subsequent commands hang.


Actual results:
[root@win10 Temp]# rpm -q yum rpm
yum-3.4.3-161.el7.noarch
rpm-4.11.3-35.el7.x86_64

[root@win10 Temp]# rpm -qa | wc -l
163

[root@win10 Temp]# rpm --rebuilddb

[root@win10 Temp]# rpm -qa | wc -l
0 <--------------------------------------- Should be 163!

[root@win10 Temp]# rpm -qa | wc -l <------ hangs


Expected results:
Post rebuilddb commands should still work.


Additional info:

Comment 2 James Hartsock 2019-01-22 15:49:24 UTC
Some public discussion going on at:

https://github.com/Microsoft/WSL/issues/90
https://github.com/Microsoft/WSL/issues/3742

Comment 3 Panu Matilainen 2019-02-01 08:11:36 UTC

*** This bug has been marked as a duplicate of bug 1668380 ***

Comment 4 James Hartsock 2019-03-04 03:49:43 UTC
 === In Red Hat Customer Portal Case 02291494 ===
--- Comment by Hartsock, James on 3/3/2019 9:49 PM ---

Hayden's work-around does work for me too....

[root@win10 rpm]# rpm --rebuilddb
[root@win10 rpm]# dd if=/dev/zero of=/var/lib/rpm/__db.001 count=0 bs=1 seek=1M
[root@win10 rpm]# dd if=/dev/zero of=/var/lib/rpm/__db.002 count=0 bs=1 seek=1M
[root@win10 rpm]# dd if=/dev/zero of=/var/lib/rpm/__db.003 count=0 bs=1 seek=1M

[root@win10 ~]# rpm -q rpm
rpm-4.11.3-32.el7.x86_64