Bug 1131279

Summary: mock package has a questionable scriptlet, leading to errors about rpm db version mismatch
Product: [Fedora] Fedora Reporter: Kalev Lember <kalevlember>
Component: mockAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jdisnard, mebrown, msimacek, msuchy, praiskup, williams
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mock-1.2.3-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-12 04:07:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kalev Lember 2014-08-18 21:32:41 UTC
I'm seeing the following errors in buildSRPMFromSCM root.logs on F21 koji builders:

DEBUG util.py:283:  error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
DEBUG util.py:283:  error: cannot open Packages index using db5 -  (-30969)
DEBUG util.py:283:  error: cannot open Packages database in /var/lib/rpm
DEBUG util.py:283:  /var/tmp/rpm-tmp.P1oO1O: line 18: [: too many arguments
DEBUG util.py:283:  warning: %post(mock-1.1.41-1.fc21.noarch) scriptlet failed, exit status 254
DEBUG util.py:283:  Non-fatal POSTIN scriptlet failure in rpm package mock-1.1.41-1.fc21.noarch

Looks like they are caused by mock invoking rpm in its %post script:

if [ -e /etc/fedora-release ]
then
    if grep -Fq Rawhide /etc/fedora-release; then
        ver=rawhide
    else
        ver=$(rpm -q --nosignature --qf "%{VERSION}" --whatprovides fedora-release)
    fi
else
    ver=$(rpm -q --nosignature --qf "%{VERSION}" --whatprovides redhat-release | cut -d. -f1 | grep -o '[0-9]\+')
fi

One of such logs:
https://kojipkgs.fedoraproject.org//work/tasks/3933/7413933/root.log

Comment 1 Miroslav Suchý 2014-11-03 15:35:19 UTC
I removed usage of rpm. Instead I parse /etc/os-release where available and otherwise (just el6 right now) use buildtime value.

Commited as 84101c3.

Comment 2 Fedora Update System 2014-11-16 17:37:21 UTC
mock-1.2.1-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc21

Comment 3 Fedora Update System 2014-11-16 17:38:44 UTC
mock-1.2.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.fc20

Comment 4 Fedora Update System 2014-11-16 17:39:35 UTC
mock-1.2.1-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el7

Comment 5 Fedora Update System 2014-11-16 17:40:35 UTC
mock-1.2.1-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.1-1.el6

Comment 6 Fedora Update System 2014-11-17 06:29:40 UTC
Package mock-1.2.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-15217/mock-1.2.1-1.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-12-04 12:06:59 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 8 Fedora Update System 2014-12-04 12:10:28 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 9 Fedora Update System 2014-12-04 12:11:26 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 10 Fedora Update System 2014-12-12 04:07:54 UTC
mock-1.2.3-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-12-17 04:42:58 UTC
mock-1.2.3-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2015-01-06 02:06:43 UTC
mock-1.2.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.