[Rpm-maint] [rpm-software-management/rpm] DB is inconsistent (#917)
ifel
notifications at github.com
Mon Oct 28 16:25:42 UTC 2019
Sometimes the RPM db gets corrupted in a way, a package look installed to some rpm commands like rpm -qa and not to the others like rpm -e. It also affects yum. I'm under impression, there is data of the package in different tables, and some commands use the one table and the others another, so, if the data is inconsistent (there is an entry in one place and not in the other) it fails this way.
Interesting notice - only bdb and ndb backends affected, but not lmdb. I don't know the internals, either the DB structure is different or, lmdb writes data to the disk only in case if all the operations succeeded, so essentially it's a single transaction, and if rpm process got killed or something after updating one place and before updating another, nothing will be written. But it's a fact, I can see this only on ndb and bdb.
Example:
The package is installed on the host:
# rpm -qa | grep fb-smc-observer-bootstrap-file
fb-smc-observer-bootstrap-file-20191027-040347.x86_64
RPM itself cannot remove it as "it's not installed"
# rpm -e fb-smc-observer-bootstrap-file
error: package fb-smc-observer-bootstrap-file is not installed
But it is installed:
# rpm -qa | grep fb-smc-observer-bootstrap-file
fb-smc-observer-bootstrap-file-20191027-040347.x86_64
Rebuild DB fixes the DB
# rpm --rebuilddb
Yum can find the package now
# yum remove fb-smc-observer-bootstrap-file
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
--> Running transaction check
---> Package fb-smc-observer-bootstrap-file.x86_64 0:20191027-040347 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
Removing:
fb-smc-observer-bootstrap-file x86_64 20191027-040347 installed 110 k
Transaction Summary
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
Remove 1 Package
Installed size: 110 k
Is this ok [y/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2019-10-28.09-13.GN2dE6.yumtx
And RPM can remove it now
# rpm -e fb-smc-observer-bootstrap-file
warning: file /var/facebook/smc/SmcObserver.json: remove failed: No such file or directory
# rpm -qa | grep fb-smc-observer-bootstrap-file
#
--
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/917
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191028/96b94c14/attachment.html>
More information about the Rpm-maint
mailing list