ManageIQ / manageiq-smartstate

Apache License 2.0
4 stars 36 forks source link

[RFE] Support RHEL / CentOS Stream 9 #180

Open agrare opened 10 months ago

agrare commented 10 months ago

RHEL 9 does not have a /lib/rpm/Packages database for the package scanner, resulting in no package list being created

evm[2302]: DEBUG -- evm: Q-task_id([job_dispatcher]) Processing RPM package database
evm[2302]: ERROR -- evm: Q-task_id([job_dispatcher]) MIQExtract.extract File not found: '/lib/rpm/Packages'

At a high level there are two issues here,

  1. MiqSqlite doesn't work with a standard rpmdb.sqlite sqlite3 database
  2. MiqRpmPackages doesn't understand the format of the rpmdb.sqlite database

MiqSqlite:

RpmDb:

Fryguy commented 10 months ago

I thought the location is /var/lib/rpm/Packages and I had thought it was there for a long time.

Fryguy commented 10 months ago

Oh interesting, seems there's now a /var/lib/rpm/rpmdb.sqlite (luckily we have SQLite support)

Fryguy commented 10 months ago

SQLite added and BDB deprecated in https://rpm.org/wiki/Releases/4.16.0 (current version is 4.19)

miq-bot commented 6 months ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

nasark commented 4 weeks ago

The Packages table which we need to read has a BLOB column. As a result when reading the column using the built-in MiqSqlite3 class (with changes accounting for the new path /var/lib/rpm/rpmdb.sqlite), raw binary data is returned. The result is the same when using the sqlite3 gem and CLI.

The details on the format of rpmdb are not publicly disclosed but we could potentially use the librpm API to access the database. This will require the use of ffi since the librpm API is written in C and I am currently investigating this route