Bug 1217999

Summary: rpmdb: failed to rebuild database: original database remains in place
Product: [openSUSE] openSUSE Tumbleweed Reporter: Rich Coe <rcoe>
Component: OtherAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Rich Coe 2023-12-12 21:40:49 UTC
I had an old opensuse (13.1) system I wanted to upgrade to tumbleweed.
The repo contents has changed since then, so upgrading directly to tumbleweed was not possible.

I upgraded to 15.0, then to 15.6, and then tumbleweed.

During install, I got the following output:

( 625/5544) Installing: dhcp-4.4.2.P1-15.1.x86_64 ...[done]
Updating /etc/sysconfig/services ...
( 626/5544) Installing: rpm-4.18.0-6.2.x86_64 ...[done]
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Converting database from bdb_ro to ndb backend
error: cannot add record originally at 6
warning: failed to rebuild database: original database remains in place
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
error: cannot open Packages database in /usr/lib/sysimage/rpm
( 627/5544) Installing: curl-8.4.0-1.1.x86_64 ...[error]
Installation of curl-8.4.0-1.1.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: Command exited with status 1.
Abort, retry, ignore? [a/r/i] (a): r
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Converting database from bdb_ro to ndb backend
error: cannot add record originally at 6
warning: failed to rebuild database: original database remains in place
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
error: cannot open Packages database in /usr/lib/sysimage/rpm
( 627/5544) Installing: curl-8.4.0-1.1.x86_64 ...[error]
Installation of curl-8.4.0-1.1.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: Command exited with status 1.
Abort, retry, ignore? [a/r/i] (a):

In the rpm post-install script, this line fails:
test -f usr/lib/sysimage/rpm/Packages -o -f usr/lib/sysimage/rpm/Packages.db || rpmdb --initdb

I ran the following commands:
# rpmdb --initdb
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Converting database from bdb_ro to ndb backend
error: cannot add record originally at 6
warning: failed to rebuild database: original database remains in place
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
# rpmdb --rebuilddb
warning: Converting database from bdb_ro to ndb backend

After I fixed the rpmdb, I successfully proceeded on the installation.

openSUSE Tumbleweed version 20231205-0
Comment 1 Stefan Hundhammer 2023-12-13 08:49:03 UTC
This is clearly not a problem of the installer (YaST).

If you don't know which Bugzilla component to choose, please use "Other", NOT "Installation".
Comment 2 Stefan Hundhammer 2023-12-13 08:50:20 UTC
IIRC somewhere between openSUSE 13.x and Leap / SLE 15.0 (or even 12.0) there was a change from RPM v3.x to RPM v4.x. That might have something to do with this.
Comment 3 Stefan Hundhammer 2023-12-13 08:54:23 UTC
Between your ancient openSUSE 13.1 and today's 15.5 / TW (15.6 is not officially released yet) there were so many fundamental changes that a fresh installation is strongly advised.

And openSUSE 13.1 went out of support 7 years ago (Feb 2016).
Don't expect anybody to expect significant time on this.
Comment 4 Stefan Hundhammer 2023-12-13 08:57:52 UTC
(In reply to Stefan Hundhammer from comment #3)
> Don't expect anybody to expect significant time on this.
                          ^^^^^^
                          spend
Comment 5 hui 2023-12-13 09:13:03 UTC
Also given the fact that this scenario is clearly not supported, this seems invalid as the user willingly ignored upgrade instructions:

"Do not skip a release when upgrading! Example: do not upgrade from 15.1 to 15.4. Instead, from 15.1 upgrade to 15.2, then to 15.3, and only then from 15.3 upgrade to 15.4."

https://en.opensuse.org/SDB:System_upgrade#General_rules
Comment 6 Stefan Hundhammer 2023-12-13 09:27:32 UTC
@hui: Good point.

Closing.