Fedora Account System
Red Hat Associate
Red Hat Customer
Created attachment 1764933 [details] dnf.log 1 Description of problem: No access to rpm package database after upgrade from f32 to f34 with `dnf system-upgrade` Version-Release number of selected component (if applicable): [root@mother rave]# rpm -qa rpm rpm-4.16.1.2-6.fc34.x86_64 How reproducible: Upgrading f32 to f34 via dnf system-upgrade Steps to Reproduce: 1.start dnf system-upgrade from f32 2.boot into f34 after upgrade 3. try to use dnf or rpm command Actual results: warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend. Running transaction check warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend. Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction RPM: warning: Found bdb_ro Packages database while attempting sqlite backend: using bdb_ro backend. RPM: error: cannot open Packages index using bdb_ro - Operation not permitted (1) RPM: error: cannot open Packages database in /var/lib/rpm The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: Could not run transaction. Expected results: no problems Additional info: `rpm --rebuilddb` fixes the problem
Created attachment 1764935 [details] next log
Created attachment 1764936 [details] next log 2
Created attachment 1764937 [details] next log 3
The database is supposed to be converted (see https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb) in the upgrade process, but various things can of course go wrong. Likely victim of bug 1461313, see also bug 1836108. This ought to clear it, if not then we'll need to investigate further: # restorecon -v /var/lib/rpm/Packages # rpmdb --rebuilddb
I simply followed those steps to upgrade f32 to f34 (system with selinux disabled): dnf upgrade --refresh dnf install dnf-plugin-system-upgrade dnf system-upgrade download --refresh --releasever=34 dnf system-upgrade reboot After the upgrade was done i did run in this issue. And i had to rebuild rpm package database with `rpm --rebuilddb`. Well, i was very surprised that this was needed and i expect that this can be done at the end of the upgrade process automatic, or not? I can test it again with a f32 VM to verify the issue.
As I said in my initial response, it's supposed to be handled automatically by the upgrade process, but as with anything, things can go wrong. By far the most common issue has been selinux related problems, but there could be others. The important thing is that you got the db converted in the end, chasing down an isolated failure doesn't warrant a whole lot of effort. But as a basic sanity check, what does the following say on that system: systemctl status rpmdb-rebuild
OK, [root@mother rave]# systemctl status rpmdb-rebuild ○ rpmdb-rebuild.service - RPM database rebuild Loaded: loaded (/usr/lib/systemd/system/rpmdb-rebuild.service; disabled; vendor preset: enabled) Active: inactive (dead)
Updating a f32 VM to f34 was successful and here the rpm database isn't broken. Also the message is different. [root@f32-test rave]# systemctl status rpmdb-rebuild ○ rpmdb-rebuild.service - RPM database rebuild Loaded: loaded (/usr/lib/systemd/system/rpmdb-rebuild.service; enabled; vendor preset: enabled) Active: inactive (dead) since Mon 2021-03-22 21:38:35 CET; 24min ago Process: 705 ExecStart=/usr/bin/rpmdb --rebuilddb (code=exited, status=0/SUCCESS) Process: 707 ExecStartPost=rm -f /var/lib/rpm/.rebuilddb (code=exited, status=0/SUCCESS) Main PID: 705 (code=exited, status=0/SUCCESS) CPU: 1.269s Mär 22 21:38:33 f32-test.mother.loc systemd[1]: Starting RPM database rebuild... Mär 22 21:38:33 f32-test.mother.loc rpmdb[705]: Warnung: Converting database from bdb_ro to sqlite backend Mär 22 21:38:35 f32-test.mother.loc systemd[1]: rpmdb-rebuild.service: Deactivated successfully. Mär 22 21:38:35 f32-test.mother.loc systemd[1]: Finished RPM database rebuild. Mär 22 21:38:35 f32-test.mother.loc systemd[1]: rpmdb-rebuild.service: Consumed 1.269s CPU time. Anyway, it seems it was only a one-shot and i know what to do when it happens again with another system. So feel free to close the report. Thanks for your analyse.
Hmm, now i am getting this problem when using mock build server for building my rpm. How can i fix this inside mock?
With mock, you'll want to use --use-bootstrap-image whenever building for a different distro version. Closing as per above comments, if this becomes more of a pattern then we'll need to investigate. Thanks for the report anyway!