RPM Community Forums

Mailing List Message of <rpm-devel>

Re: strange RPMDB problem: messed up entries (regularily)

From: Jeff Johnson <n3npq@mac.com>
Date: Mon 18 Aug 2008 - 15:44:50 CEST
Message-id: <9100C5FE-6724-4041-8803-65C84349F082@mac.com>

On Aug 18, 2008, at 8:26 AM, Ralf S. Engelschall wrote:

> On Mon, Aug 18, 2008, Ralf S. Engelschall wrote:
>
>> [...]
>> | error: rpmdb: skipping h#      42 blob size(4140): BAD, 8 + 16 *  
>> il(959996723) + dl(825374516)
>> | error: db4 error(-30986) from dbcursor->get: DB_PAGE_NOTFOUND:  
>> Requested page not found
>>
>> Notice the error at the end. I can easily recover from this problem
>> by just running "openpkg rpm --rebuilddb". This then once again shows
>> the same error but at least results in no more errors during the next
>> "openpkg rpm -qa". BUT! The problem then is still not gone:  
>> "openpkg rpm
>> -qi openpkg" then shows:
>>
>> | # /usr/opkg/bin/openpkg rpm -qi openpkg
>> | package openpkg is not installed
>
> It now happened just again on a different instance. Interesting aspect
> I found out this time:
>

<... snip ...>

> Notice the "--db-rebuild" instead of "--rebuildb" here and the fact
> that with "--rebuilddb" I usually loose the "openpkg" entry while with
> "--db-rebuild" I do not.
>
> To explain: "--db-xxxx" are RPM aliases to OpenPKG's "rpmdb" addon
> script and its "--db-rebuild" actually does a full "dump" and  
> "restore"
> with the Berkeley-DB tool (for details see the attached script) while
> "--rebuildb" is RPM-internal.
>
> Very interesting that the full dump/restore via external tools is
> able to resurrect the database without information loss while RPM's
> --rebuilddb seems to kick away data. Hmm...
>

I'll study the script, but my initial guess is "coincidence" wrto -- 
rebuilddb vs --db-rebuilddb.

You most certainly want to remove (and recreate) a damaged cache  
before attempting --rebuildb
however.

The damaged cache can change what --rebuilddb "sees" as the contents  
of an rpmdb and end
up doing more harm than good. I've seen bug reports where --rebuilddb  
over a damaged cache
loses an entire rpmdb. Caveat emptor ...

Specifically
     rm -f /var/lib/rpm/__db*
     rpm --rebuilddb
is recommended for careful professional work when DB_PAGE_NOTFOUND is  
seen.

(aside) And no, the cache removal should not be automated in -- 
rebuilddb any more
than RPM should be insturmented with an interface to radar dishes
scanning the sky for possible meteor strikes within 2m of keyboard ...

73 de Jeff
Received on Mon Aug 18 15:45:33 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.