Re: [Rpm-maint] [rpm-software-management/rpm] Failure to read rpmdb from CentOS 7.5.1804 with the bdb_ro backend (#1576)

2021-03-19 Thread Panu Matilainen
Closed #1576 via #1578.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1576#event-4480394421___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Failure to read rpmdb from CentOS 7.5.1804 with the bdb_ro backend (#1576)

2021-03-15 Thread Philippe Ombredanne
@pmatilai Thank you ++ for these commits!
Let me test that.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1576#issuecomment-799836920___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Failure to read rpmdb from CentOS 7.5.1804 with the bdb_ro backend (#1576)

2021-03-11 Thread Philippe Ombredanne
@mlschroe what would be your take on this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1576#issuecomment-796982259___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Failure to read rpmdb from CentOS 7.5.1804 with the bdb_ro backend (#1576)

2021-03-11 Thread Philippe Ombredanne
To reproduce, this base rootfs for Docker  contains an rpmdb 
https://github.com/CentOS/sig-cloud-instance-images/blob/CentOS-7.5.1804/docker/centos-7-docker.tar.xz?raw=true
 

Then compile rpm with these [configure 
flags](https://github.com/nexB/scancode-plugins/blob/develop/builtins/rpm_inspector_rpm/build.sh)
 (I used rpm-4.16.1.2-release, but the latest head should have the same issue)
```
./autogen.sh \
  --enable-static \
  --disable-openmp \
  --enable-bdb=no \
  --enable-bdb-ro=yes \
  --enable-ndb \
  --enable-sqlite=yes \
  --disable-plugins \
  --without-lua  \
  --with-crypto=openssl
```
Then run this rpm command on the extracted rootfs:

```
rpm --query --all --verbose --verbose --dbpath /var/lib/rpm

D: Found bdb_ro Packages database: using bdb_ro backend.
D: opening  db index   /var/lib/rpm/Packages
D: opening  db index   /var/lib/rpm/Name
D: opening  db index   /var/lib/rpm/Basenames
D: opening  db index   /var/lib/rpm/Group
D: opening  db index   /var/lib/rpm/Requirename
D: opening  db index   /var/lib/rpm/Providename
D: opening  db index   /var/lib/rpm/Conflictname
D: opening  db index   /var/lib/rpm/Obsoletename
D: opening  db index   /var/lib/rpm/Triggername
D: opening  db index   /var/lib/rpm/Dirnames
D: opening  db index   /var/lib/rpm/Installtid
D: opening  db index   /var/lib/rpm/Sigmd5
D: opening  db index   /var/lib/rpm/Sha1header
D: opening  db index   /var/lib/rpm/Filetriggername
error: /var/lib/rpm/Filetriggername: pread: Bad file descriptor
error: could not open /var/lib/rpm/Filetriggername: Bad file 
descriptor
error: cannot open Filetriggername index using bdb_ro - Operation not permitted 
(1)
error: cannot open Packages database in /var/lib/rpm
```

Basically as pointed to by @Conan-Kudo this RPM was built with 4.11.3 and  
Filetriggername appeared circa 4.13
IMHO we should be able to read all rpmdb with bdb_ro that would have this 
file/magic:
```
$ file /var/lib/rpm/*
/var/lib/rpm/Basenames:Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Conflictname: Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/__db.001: Applesoft BASIC program data, first 
line number 18
/var/lib/rpm/__db.002: a.out little-endian 32-bit pure 
executable
/var/lib/rpm/__db.003: a.out little-endian 32-bit pure 
executable not stripped
/var/lib/rpm/Dirnames: Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Group:Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Installtid:   Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Name: Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Obsoletename: Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Packages: Berkeley DB (Hash, version 9, native 
byte-order)
/var/lib/rpm/Providename:  Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Requirename:  Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Sha1header:   Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Sigmd5:   Berkeley DB (Btree, version 9, 
native byte-order)
/var/lib/rpm/Triggername:  Berkeley DB (Btree, version 9, 
native byte-order)
```

and we should be able to cope with not having all the data files present, such 
as here  `Filetriggername`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1576___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint