Bug 1668379

Summary: Under Microsoft WIndows Subsystem for Linux (WSL) - Error: rpmdb open failed [fedora]
Product: [Fedora] Fedora Reporter: James Hartsock <hartsjc>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: igor.raits, mjw, ngompa13, packaging-team-maint, pmatilai, pmoravco, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1668380 (view as bug list) Environment:
Last Closed: 2019-02-01 08:12:18 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:    
Bug Blocks: 1668380    

Description James Hartsock 2019-01-22 15:38:46 UTC
Description of problem:
Fedora (and RHEL 8 beta) systems have following errors with dnf immediately.

Version-Release number of selected component (if applicable):
Fedora release 29 (Twenty Nine)

How reproducible:
Very

Steps to Reproduce:
1. Take Fedora (or RHEL 8 Beta) container image, export it as tar and gzip
   # podman pull registry.fedoraproject.org/fedora
   # podman run -it fedora sleep 999999
   # podman ps
   CONTAINER ID
   <ContainID>
   # podman export <ContainID> -o fedora.tar
   # podman kill   <ContainID>

2. Use https://github.com/DDoSolitary/LxRunOffline on Windows

   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe install -n Fedora -d Fedora -f fedora.tar.gz
   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe set-default -n Fedora
   C:\Temp>LxRunOffline-v3.3.2\LxRunOffline.exe get-default
   Fedora

3. Run rpm or dnf command


Actual results:
[root@win10 Temp]# rpm -qa
error: db5 error(12) from dbenv->open: Cannot allocate memory
error: db5 error(22) from dbenv->close: Invalid argument
error: cannot open Packages index using db5 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
error: db5 error(12) from dbenv->open: Cannot allocate memory
error: db5 error(22) from dbenv->close: Invalid argument
error: cannot open Packages index using db5 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm

Expected results:
Should not be RPM issues


Additional info:

WSL info @ https://docs.microsoft.com/en-us/windows/wsl/install-win10

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

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

Comment 2 Panu Matilainen 2019-02-01 08:12:18 UTC
If mmap() would fail with EINVAL or such we could deal with it, but as long as WSL is pretending all is well we can't help.

There are several tickets on WSL reporting how Berkeley DB and LMDB are broken because of mmap() issues, eg
https://github.com/Microsoft/WSL/issues/3451 and https://github.com/Microsoft/WSL/issues/658

A bug in WSL can only be fixed in WSL.