Bug 32880

Summary: Packages corrupted while installing an rpm with disk full
Product: [Retired] Red Hat Linux Reporter: Alex Vorobiev <sasha>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DEFERRED QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-03-23 20:29:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Vorobiev 2001-03-23 20:29:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14 i686)


Packages file gets corrupted when trying to install any RPM while the disk
is full.  

can't tell actuall package revisions 'cause rpm db is corrupt:
latest RPM, from updates
latest db3, from updates

/var partition filled up
while trying to install latest vim-common from updates, received error that
mentions a .c file (unfortunately, haven't saved the error message). 
immediately after that, any rpm queries would fail:

[root@sasha rpm]# rpm -qa
error: cannot open Packages index using db3 - Invalid argument (22)

[root@sasha rpm]# rpm --rebuilddb
error: cannot open Packages index

[root@sasha rpm]# db_verify Packages 
db_verify: Page 1197: Invalid next_pgno 1198
db_verify: DB->verify: Packages: DB_VERIFY_BAD: Database verification
failed

[root@sasha rpm]# db_dump -f dump Packages 
db_dump: Packages: file size not a multiple of the pagesize
db_dump: open: Packages: Invalid argument

this happened twice already.  my fault for not keeping an eye on the
partition, but i figure that the rpm db getting corrupted is a bad thing
and shouldn't happen anyway.  i don't know of any way to restore that file,
using -r and -R options with db_dump yield an unusable db file...  it's a
pain to lose my rpm db again...

any help would be appreciated

--sasha

Reproducible: Didn't try
Steps to Reproduce:
i've reproduced it, but not intentionally.  my best guess is that it is
caused by full disk

Comment 1 Jeff Johnson 2001-03-23 21:00:52 UTC
Sorry, I dunno of any fix either, although you're basically on the right path by
looking
for db3 utilities to fix the hash access /var/lib/rpmPackages file.

The Right Thing To Do for rpm is to enable logging and transactions in db3, but
that hasn't been deemed worth the engineering effort yet.