Bug 1366122 - mean to recover from corrupted rpmdb
Summary: mean to recover from corrupted rpmdb
Keywords:
Status: CLOSED DUPLICATE of bug 1284981
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-11 06:13 UTC by Oleg Drokin
Modified: 2016-08-15 11:45 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-15 11:45:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Oleg Drokin 2016-08-11 06:13:33 UTC
Description of problem:

I was doing dnf in-place distro-sync from Fedora23 to Fedora24 on a couple of nodes when something happened with power and the nodes turned off.
Both nodes were in the cleanup phase after installing new packages.

After reboot, when I tried to repeat the distro-sync command (since there does not appear to be any way to finish the previous aborted transaction),
dnf told me it's just going to erase a bunch of old fc23 packages which looked ok since all the fc24 packages were already installed.

In fact apparently it just removed everything:
  Erasing     : nss-softokn-freebl-3.25.0-1.0.fc23.x86_64               398/407 
  Erasing     : glibc-2.22-17.fc23.x86_64                               399/407 
warning: /usr/lib64/gconv/gconv-modules saved as /usr/lib64/gconv/gconv-modules.rpmsave
warning: /etc/nsswitch.conf saved as /etc/nsswitch.conf.rpmsave
warning: %postun(glibc-2.22-17.fc23.x86_64) scriptlet failed, exit status 126
Non-fatal POSTUN scriptlet failure in rpm package glibc
Non-fatal POSTUN scriptlet failure in rpm package glibc
  Erasing     : basesystem-11-1.fc23.noarch                             400/407 
  Erasing     : filesystem-3.2-35.fc23.x86_64                           401/407 
warning: directory /tmp: remove failed: Device or resource busy
warning: directory /sys: remove failed: Device or resource busy
warning: directory /run: remove failed: Device or resource busy
warning: directory /proc: remove failed: Device or resource busy
warning: directory /dev: remove failed: Device or resource busy
warning: directory /boot: remove failed: Device or resource busy
warning: directory /: remove failed: Device or resource busy
  Erasing     : setup-2.10.1-1.fc23.noarch                              402/407 
warning: /etc/shadow saved as /etc/shadow.rpmsave
warning: /etc/passwd saved as /etc/passwd.rpmsave
warning: /etc/gshadow saved as /etc/gshadow.rpmsave
warning: /etc/group saved as /etc/group.rpmsave
  Erasing     : fedora-repos-23-1.noarch                                403/407 
warning: /etc/yum.repos.d/fedora.repo saved as /etc/yum.repos.d/fedora.repo.rpmsave
  Erasing     : fedora-release-23-1.noarch                              404/407 
warning: /usr/lib/os.release.d/os-release-fedora saved as /usr/lib/os.release.d/os-release-fedora.rpmsave
warning: /etc/system-release-cpe saved as /etc/system-release-cpe.rpmsave
warning: /etc/fedora-release saved as /etc/fedora-release.rpmsave
  Erasing     : ncurses-base-5.9-21.20150214.fc23.noarch                405/407 
  Erasing     : tzdata-2016f-1.fc23.noarch                              406/407 
  Erasing     : libgcc-5.3.1-6.fc23.x86_64                              407/407 
warning: file /lib64/libgcc_s.so.1: remove failed: No such file or directory
warning: file /lib64/libgcc_s-5.3.1-20160406.so.1: remove failed: No such file or directory
Failed loading RPMDB.


This is with Fedora24's dnf-1.1.9-2.fc24 at this point.

One would hope that dnf would be somewhat more sensible and detect that there's a different package version installed too and just needs to clean stuff in rpmdb or something similar, even better if it can resume previous transaction, I guess.

I only lost one node in such a way because the other one just got stuck due to some rpmdb corruption, so it did not get to progress much, but now I wonder how to recover from this situation where I seemingly have double packages that were not cleaned up before like this:
# rpm -qa | grep zlib
zlib-1.2.8-9.fc23.x86_64
zlib-1.2.8-10.fc24.x86_64


I have a faint memory of encountering something similar in the past with yum and there yum sensibly only removed data from rpmdb and not new files from newer installed package.

Comment 1 Honza Silhan 2016-08-15 11:45:01 UTC

*** This bug has been marked as a duplicate of bug 1284981 ***


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