Description of problem: I noticed error in upgrade on rawhide CI machines. Version-Release number of selected component (if applicable): rpm -q glibc rpm libdb glibc-2.25.90-15.fc27.x86_64 rpm-4.13.0.1-25.fc27.x86_64 libdb-5.3.28-22.fc27.x86_64 How reproducible: Deterministic Steps to Reproduce: 1. dnf install -y --setopt=debuglevel=0 --setopt=errorlevel= 0 openldap-servers 2. rpm -q libdb 3. dnf update -y libdb Actual results: [root@262a5d724d4a /]# dnf install -y --setopt=debuglevel=0 --setopt=errorlevel= 0 openldap-servers Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another loca le or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Failed to connect to bus: No such file or directory [root@262a5d724d4a /]# [root@262a5d724d4a /]# rpm -q libdb libdb-5.3.28-22.fc27.x86_64 [root@262a5d724d4a /]# dnf update -y libdb Python detected LC_CTYPE=C: LC_CTYPE & LANG coerced to C.UTF-8 (set another loca le or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior). Last metadata expiration check: 0:03:39 ago on Wed Jun 28 08:57:23 2017. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Upgrading: libdb x86_64 5.3.28-24.fc27 rawhide 752 k libdb-utils x86_64 5.3.28-24.fc27 rawhide 142 k Transaction Summary ================================================================================ Upgrade 2 Packages Total download size: 894 k Downloading Packages: (1/2): libdb-utils-5.3.28-24.fc27.x86_64.rpm 19 MB/s | 142 kB 00:00 (2/2): libdb-5.3.28-24.fc27.x86_64.rpm 42 MB/s | 752 kB 00:00 -------------------------------------------------------------------------------- Total 824 kB/s | 894 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Upgrading : libdb-5.3.28-24.fc27.x86_64 1/4 Running scriptlet: libdb-5.3.28-24.fc27.x86_64 1/4 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch error: cannot open Packages index using db5 - (-30969) error: cannot open Packages database in /var/lib/rpm error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch error: cannot open Packages index using db5 - (-30969) error: cannot open Packages database in /var/lib/rpm Upgrading : libdb-utils-5.3.28-24.fc27.x86_64 2/4 Cleanup : libdb-utils-5.3.28-22.fc27.x86_64 3/4 Running scriptlet: libdb-5.3.28-22.fc27.x86_64 4/4 Cleanup : libdb-5.3.28-22.fc27.x86_64 4/4 Running scriptlet: libdb-5.3.28-22.fc27.x86_64 4/4 Verifying : libdb-5.3.28-24.fc27.x86_64 1/4 Verifying : libdb-utils-5.3.28-24.fc27.x86_64 2/4 Verifying : libdb-5.3.28-22.fc27.x86_64 3/4 Verifying : libdb-utils-5.3.28-22.fc27.x86_64 4/4 Upgraded: libdb.x86_64 5.3.28-24.fc27 libdb-utils.x86_64 5.3.28-24.fc27 Complete! Expected results: no errors in upddate Additional info: I haven't noticed any functional problems after upgrade yet.
The simplest reproducer is within within docker containers docker run --rm -ti registry.fedoraproject.org/fedora:26 bash # which contains libdb-5.3.28-22.fc27.x86_64 before upgrade or with docker.io version docker run -ti --rm docker.io/fedora:rawhide bash # which contains libdb-5.3.28-17.fc26.x86_64 before upgrade Error is visible in both cases BTW I cannot see problem on fedora 26 + upgrade to latest koji build https://koji.fedoraproject.org/koji/buildinfo?buildID=911754
These are expected to happen as far as libdb is concerned. The DB_VERSION_MISMATCH errors are (in this case) a result of a rpm scriptlet trying to call rpm commands during the update of libdb which something that is not supported as far as the rpm maintainers are concerned. The discussion on this can be found buried inside bug 1394862. The most relevant is probably this comment: https://bugzilla.redhat.com/show_bug.cgi?id=1394862#c52 You can check which package's scriptlet failed (in your it would probably be openldap-servers) by running dnf update with the argument "--rpmverbosity debug" and then look up the scriptlet code inside the package's .spec file to see if the failure might have caused some other issues. As this is a recent change (introduced in -21, then removed again in -22 and reintroduced in -24) as is not documented anywhere for rawhide (afaik) I will keep this bug open for now. Feel free to change the component to rpm if you think these errors should be more descriptive. >BTW I cannot see problem on fedora 26 + upgrade to latest koji build Fedora 26 beta shipped with -21 release of libdb which is able to update cleanly to -24.
(In reply to Petr Kubat from comment #2) > As this is a recent change (introduced in -21, then removed again in -22 and > reintroduced in -24) as is not documented anywhere for rawhide (afaik) I > will keep this bug open for now. Feel free to change the component to rpm if > you think these errors should be more descriptive. > Then it explains why I saw it in rawhide on CI machines. I had -22 there Updated libdb-5.3.28-22.fc27.x86_64 @rawhide Update 5.3.28-24.fc27.x86_64 @rawhide Updated libdb-utils-5.3.28-22.fc27.x86_64 @rawhide Update 5.3.28-24.fc27.x86_64 @rawhide I let you decide whether it should be closed or moved to rpm. Thank you very much for explanation.
FYI I upgraded my laptop from f26 to f27 and I saw this error many times. libdb was upgraded from libdb-5.3.28-24.fc26.x86_64 -> libdb-5.3.28-24.fc27.x86_64 [root@host ~]# dnf history info last | tail -n 49 Scriptlet output: 1 warning: /etc/yum.repos.d/fedora-rawhide.repo created as /etc/yum.repos.d/fedora-rawhide.repo.rpmnew 2 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 3 error: cannot open Packages index using db5 - (-30969) 4 error: cannot open Packages database in /var/lib/rpm 5 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 6 error: cannot open Packages index using db5 - (-30969) 7 error: cannot open Packages database in /var/lib/rpm 8 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 9 error: cannot open Packages index using db5 - (-30969) 10 error: cannot open Packages database in /var/lib/rpm 11 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 12 error: cannot open Packages index using db5 - (-30969) 13 error: cannot open Packages database in /var/lib/rpm 14 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 15 error: cannot open Packages index using db5 - (-30969) 16 error: cannot open Packages database in /var/lib/rpm 17 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 18 error: cannot open Packages index using db5 - (-30969) 19 error: cannot open Packages database in /var/lib/rpm 20 Applying workaround for broken SELinux policy: https://bugzilla.redhat.com/show_bug.cgi?id=1381331 21 ValueError: File context for /usr/libexec/cockpit-ssh already defined 22 checkmodule: loading policy configuration from /tmp/tmp.0GAFo11zGQ/local.te 23 checkmodule: policy configuration loaded 24 checkmodule: writing binary representation (version 17) to /tmp/tmp.0GAFo11zGQ/local.mod 25 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 26 error: cannot open Packages index using db5 - (-30969) 27 error: cannot open Packages database in /var/lib/rpm 28 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 29 error: cannot open Packages index using db5 - (-30969) 30 error: cannot open Packages database in /var/lib/rpm 31 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 32 error: cannot open Packages index using db5 - (-30969) 33 error: cannot open Packages database in /var/lib/rpm 34 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 35 error: cannot open Packages index using db5 - (-30969) 36 error: cannot open Packages database in /var/lib/rpm 37 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 38 error: cannot open Packages index using db5 - (-30969) 39 error: cannot open Packages database in /var/lib/rpm 40 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 41 error: cannot open Packages index using db5 - (-30969) 42 error: cannot open Packages database in /var/lib/rpm 43 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 44 error: cannot open Packages index using db5 - (-30969) 45 error: cannot open Packages database in /var/lib/rpm 46 error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch 47 error: cannot open Packages index using db5 - (-30969) 48 error: cannot open Packages database in /var/lib/rpm
These kind of errors will unfortunately come up every time the glibc package is updated (as libdb only looks at the timestamp of its shared library), together with some other package that has scriptlets that touch the rpmdb. Or when there is some ABI change in libdb itself but that does not happen too often fortunately. I will move this to the rpm component to discuss how to move forward. My opinion is that the failures in scriptlets should at least contain the name of the component the scriptlets are hailing from so that we can start removing the source of the errors.
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'.
*** Bug 1484139 has been marked as a duplicate of this bug. ***
rpm >= 4.13.90-0.git14002.8 in rawhide and f27 has a band-aid that should permit queries to "work" (ie as unreliable as they always were) in these situations. I'll add some diagnostics later on but F27 schedule is too tight to worry about that.