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 1938928 - Backport read-only support for sqlite rpmdb
Summary: Backport read-only support for sqlite rpmdb
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rpm
Version: ---
Hardware: All
OS: All
high
high
Target Milestone: rc
: ---
Assignee: Michal Domonkos
QA Contact: Tomáš Bajer
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks: 1836094
TreeView+ depends on / blocked
 
Reported: 2021-03-15 08:42 UTC by Panu Matilainen
Modified: 2021-11-10 10:13 UTC (History)
8 users (show)

Fixed In Version: rpm-4.14.3-16.el8
Doc Type: Enhancement
Doc Text:
.RPM now has read-only support for the `sqlite` database backend The ability to query an RPM database based on `sqlite` may be desired when inspecting other root directories, such as containers.This update adds read-only support for the RPM `sqlite` database backend. As a result, it is now possible to query packages installed in a UBI 9 or Fedora container from the host RHEL 8. To do that with Podman: . Mount the container's file system with the `podman mount` command. . Run the `rpm -qa` command with the `--root` option pointing to the mounted location. Note that RPM on RHEL 8 still uses the BerkeleyDB database (`bdb`) backend.
Clone Of:
Environment:
Last Closed: 2021-11-09 20:01:59 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4489 0 None None None 2021-11-09 20:02:13 UTC

Description Panu Matilainen 2021-03-15 08:42:41 UTC
Description of problem:

RHEL 9 uses a different, sqlite-based rpmdb format that rpm of RHEL 8 cannot even read. This causes problems in various container/image situations, it's often convenient/desireable to be able to at least query the database from the "outside" of an image.

The idea was from the start that once the sqlite rpmdb backend has stabilized, we should backport a read-only version to RHEL 8 to alleviate these pains. Read-write support is out of the scope as it would require other hairy changes to rpm internals.

Comment 2 Jonathan Lebon 2021-05-05 19:18:47 UTC
> Read-write support is out of the scope as it would require other hairy changes to rpm internals.

Hi Panu,

Is there some wiggle room there to get this to happen or is it too difficult? In RHCOS, we use Fedora-based tooling to compose OSTree content. With f34 rpm losing support for bdb, and el8 not having support for sqlite we're a bit squeezed. One thing we could do once there is read-only support for sqlite in RHEL at least is to compose to sqlite (using Fedora librpm), and then use RHEL rpm to convert it back to bdb. Though ideally if it just supported sqlite for read and write, we could leave bdb behind entirely and simplify composes.

See discussions in https://github.com/openshift/os/pull/548.

Comment 3 Panu Matilainen 2021-05-06 10:03:03 UTC
As you even quoted, I explicitly stated write support is out of scope due to requiring hairy changes to rpm internals. There are no ifs and buts in that.

Comment 4 Colin Walters 2021-05-17 13:13:51 UTC
Doesn't seem worth trying to switch just RHCOS to sqlite by default.  OK and there's `rpmdb --exportdb` and `rpmdb --importdb` so presumably we can pipe those together to do the conversion.

Comment 6 Colin Walters 2021-07-12 18:55:19 UTC
OK https://github.com/coreos/rpm-ostree/pull/2990 is working for me and it doesn't require this patch.

That said, ultimately I can still see this patch (RHEL8 sqlite read) being useful because it means other projects/situations like this can avoid juggling two independent versions of rpm as in the rpm-ostree approach.

Comment 26 Richard W.M. Jones 2021-10-14 11:07:14 UTC
I finally got around to testing this with the new libguestfs (bug 1836094)
and RHEL 8.6 and it appears to work well.  (I tested rpm-4.14.3-18.el8.x86_64)

Comment 27 Michal Domonkos 2021-11-03 09:43:15 UTC
Thanks, Richard, that's appreciated!

Comment 29 errata-xmlrpc 2021-11-09 20:01:59 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 (Low: rpm 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-2021:4489


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