Bug 536846

Summary: rebuild RPM DB automatically and silently when necessary
Product: [openSUSE] openSUSE Tumbleweed Reporter: Tim Fechtner <urwald>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P3 - Medium CC: Andreas.Stieger, cosoleto, forgotten_nqeDWc8OMK, ma, matti.kukkola, mls, ncutler, opensuse, urwald
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Tim Fechtner 2009-09-04 14:56:20 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.1.2) Gecko/20090730 SUSE/3.5.2-2.4 Firefox/3.5.2

Sometimes, the RPM database is broken. Than, when you try to install packages with YaST, you get some complicate error messages like

Subprocess failed. Error: RPM fallido: error: db4 error(-30987) from
dbcursor->c_get: DB_PAGE_NOTFOUND: Requested page not found
error: error(-30987) setting "System/Libraries" records from Group index
error: db4 error(-30987) from dbcursor->c_get: DB_PAGE_NOTFOUND: Requested page
not found
error: error(-30987) getting "System/Libraries" records from Group index

or

Subprocess failed. Error: RPM fallido: error: db4 error(-30987) from
dbcursor->c_get: DB_PAGE_NOTFOUND: Requested page not found
error: error(-30987) getting "" records from Requireversion index

Executing 'rpm --rebuilddb' fixes the problem, but that's not user friendly.

It would be great if libzypper could the this automatically when it notices that there are problems with the RPM database.

Reproducible: Always
Comment 1 Michael Andres 2009-10-06 13:14:09 UTC
*** Bug 544174 has been marked as a duplicate of this bug. ***
Comment 2 Francesco Cosoleto 2011-07-01 10:59:24 UTC
Reproduced on openSUSE 11.4.
Comment 3 Nathan Cutler 2017-08-11 21:18:57 UTC
I have never seen those messages, so I assume the issue was fixed long ago.
Comment 4 Nathan Cutler 2017-08-11 21:20:12 UTC
If you still want to pursue this, open an upstream issue at https://github.com/openSUSE/zypper/issues/new
Comment 5 Michael Andres 2017-08-14 12:23:29 UTC
JFYI: It makes no sense to convert a zypp bugzilla entry into a zypp github issue. Especially as our package submission policy asks for bugzilla references in the changes file, we preferably track in bugzilla.
Comment 6 Nathan Cutler 2017-08-14 12:26:41 UTC
Product has been changed to Tumbleweed, so the bug is no longer in danger of being closed just because the underlying product went out of maintenance.
Comment 7 Michael Andres 2019-02-08 15:15:14 UTC
*** Bug 308352 has been marked as a duplicate of this bug. ***
Comment 8 Maximilian Trummer 2019-06-15 19:12:41 UTC
I've run into this issue as well now. It happened on a Tumbleweed system first installed two years ago, so perhaps it's a matter of time before the RPM db corrupts.
Comment 9 Andreas Stieger 2021-09-20 06:42:37 UTC
Some considerations: 

Rebuilding "automatically and silently" hides the underlying problem and and will leads to bugs that are worde e.g. those when rebuilding does not fix the issue.

Tumbleweed rpm >= 4.16 now offers sqlite and ndb backends which are more resilient. The Tumbleweed package also disables the bdb backend from the original report and defaults to ndb. This happened in October 2020. 

The original issue can hence no longer occur. This bug should be closed.
Comment 10 Michael Schröder 2021-09-22 11:50:15 UTC
Right, this should no longer be needed if sqlite or ndb is used. Closing.