On Feb 15, 2010, at 8:09 AM, Bernhard Rosenkränzer wrote:
> Hi,
> the chroot environment that was producing bogus dependency messages when
> checking BuildRequires last week has "moved on" to not installing binary
> packages anymore, saying
>
> /var/lib/rpm/Packages: DB_SECONDARY_BAD: Secondary index inconsistent with
> primary
> error: db4 error(-30973) from dbcursor->get: DB_SECONDARY_BAD: Secondary
> index inconsistent with primary
> rpm: rpmdb.c:2179: rpmmiNext: Assertion `0' failed.
> Aborted
>
What sources are these? Presumably rpmdb.c:2179 is
else if (dbi->dbi_primary) {
rc = rpmmiGet(dbi, mi->mi_dbc, &k, &p, &v, _flags);
switch (rc) {
default:
assert(0);
/*@notreached@*/ break;
case DB_NOTFOUND:
return NULL;
/*@notreached@*/ break;
case 0:
mi->mi_setx++;
in which case DB_SECONDARY_BAD perhaps could/should
be handled somehow. Off to see if the doco describes
the specifics of DB_SECONDARY_BAD return.
> rpm --rebuilddb doesn't fix it.
>
Hmmm ... the fix for DB_SECONDARY_BAD is to regenerate
the secondary index. Which can be done by removing the
secondary index, the index will be regenerated on next
open. That's all that --rebuilddb is doing these days,
removing the secondary indices.
> Probably it's db corruption after all...
>
Do you have a reproducer? Or can you supply more context
about what access was being attempted?
73 de Jeff
Received on Mon Feb 15 14:04:20 2010