Bug 1305367 - Non-fatal POSTIN scriptlet failure in rpm package mock
Non-fatal POSTIN scriptlet failure in rpm package mock
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
24
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Miroslav Suchý
Fedora Extras Quality Assurance
:
: 1183454 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-07 12:12 EST by Vedran Miletić
Modified: 2016-08-08 17:20 EDT (History)
9 users (show)

See Also:
Fixed In Version: mock-1.2.18-1.fc23 mock-1.2.18-1.fc24 mock-1.2.18-1.el7 mock-1.2.18-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-13 00:55:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vedran Miletić 2016-02-07 12:12:19 EST
Installing mock-1.2.14-1.fc24 on rawhide gives:

  Installing  :  mock-1.2.14-1.fc24.noarch  36/63 
warning: %post(mock-1.2.14-1.fc24.noarch) scriptlet failed, exit status 254
Non-fatal POSTIN scriptlet failure in rpm package mock
Non-fatal POSTIN scriptlet failure in rpm package mock
Comment 1 Miroslav Suchý 2016-02-17 11:30:32 EST
I cannot reproduce it.
It would be nice to know content of your /etc/mock/, /etc/os-release and from which version you were updating.
Comment 2 Vedran Miletić 2016-02-17 12:50:59 EST
$ cat /etc/os-release 
NAME=Fedora
VERSION="24 (Workstation Edition)"
ID=fedora
VERSION_ID=24
PRETTY_NAME="Fedora 24 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:24"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=rawhide
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
VARIANT="Workstation Edition"
VARIANT_ID=workstation

/etc/mock does not exist. All packages are latest rawhide.

$ sudo dnf install @fedora-packager
(...)
Installing  : mock-1.2.14-2.fc24.noarch  45/67
warning: %post(mock-1.2.14-2.fc24.noarch) scriptlet failed, exit status 254
Non-fatal POSTIN scriptlet failure in rpm package mock
Non-fatal POSTIN scriptlet failure in rpm package mock
(...)

Reliably reproducible after removing @fedora-packager and then installing it again.
Comment 3 Miroslav Suchý 2016-02-17 13:40:39 EST
You do not have /etc/mock directory? That is weird because mock ship it.
Comment 4 Vedran Miletić 2016-02-17 13:44:02 EST
I have it after installation, of course.
Comment 5 Miroslav Suchý 2016-02-17 13:58:13 EST
Can you try this?:
$ wget https://kojipkgs.fedoraproject.org//packages/mock/1.2.14/2.fc24/noarch/mock-1.2.14-2.fc24.noarch.rpm
$ rpm -qp --scripts mock-1.2.14-2.fc24.noarch.rpm

And after the line:
  postinstall scriptlet (using /bin/sh):
there is the script which is run. Can you save it as shell script and execute it.
Likely
  bash -x post.sh
This will show you how variable are evaluate and show where the error occure. Can you post the result here?
Comment 6 Jan Kurik 2016-02-24 10:44:46 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 7 Vedran Miletić 2016-03-15 19:36:51 EDT
Sorry for the delay. Here is the relevant script:

preinstall scriptlet (using /bin/sh):

# check for existence of mock group, create it if not found
getent group mock > /dev/null || groupadd -f -g 135 -r mock
exit 0
postinstall scriptlet (using /bin/sh):

# fix cache permissions from old installs
chmod 2775 /var/cache/mock

if [ -s /etc/os-release ]; then
    # fedora and rhel7
    if grep -Fq Rawhide /etc/os-release; then
        ver=rawhide
    else
        ver=$(source /etc/os-release && echo $VERSION_ID | cut -d. -f1 | grep -o '[0-9]\+')
    fi
else
    # rhel6 or something obsure, use buildtime version
    ver=24
fi
mock_arch=$(python -c "import rpmUtils.arch; baseArch = rpmUtils.arch.getBaseArch(); print baseArch")
cfg=fedora-$ver-${mock_arch}.cfg
[ -e /etc/mock/$cfg ] || exit -2
if [ "$(readlink /etc/mock/default.cfg)" != "$cfg" ]; then
  ln -s $cfg /etc/mock/default.cfg 2>/dev/null || ln -s -f $cfg /etc/mock/default.cfg.rpmnew
fi
:

However, this does not happen with mock 1.2.17 which is currently in F24.
Comment 8 Miroslav Suchý 2016-03-16 02:32:32 EDT
The problem is that this error is likely triggered by some obscure situation in /etc/mock/ and I see no error by just reading the code. So unless this happen to you and then you run this code manually by hand (becouse rpm does not print the error) and you post here the error message, there is hardly enything I can do about it. :(
Comment 9 Joachim Frieben 2016-04-24 08:48:14 EDT
(In reply to Vedran Miletić from comment #7)
> However, this does not happen with mock 1.2.17 which is currently in F24.

Well, I do see this issue in current rawhide:
 "warning: %post(mock-1.2.17-1.fc25.noarch) scriptlet failed, exit status 254
  Non-fatal POSTIN scriptlet failure in rpm package mock".
Comment 10 Miroslav Suchý 2016-04-25 04:30:57 EDT
Notes for myself. It seems to be caused by this line:
  [ -e /etc/mock/$cfg ] || exit -2

I should probably change it from this fatal exit just to some warning.
Comment 11 Miroslav Suchý 2016-06-02 09:39:46 EDT
Fixed in commit
* 4630ebf (HEAD -> devel) do not fail when we cannot link default.cfg [RHBZ#1305367]
Comment 12 Fedora Update System 2016-06-10 09:13:27 EDT
mock-1.2.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-89209fd48b
Comment 13 Fedora Update System 2016-06-10 09:13:50 EDT
mock-1.2.18-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-70cdc0c410
Comment 14 Fedora Update System 2016-06-10 09:14:10 EDT
mock-1.2.18-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3d9f899f6a
Comment 15 Fedora Update System 2016-06-10 09:14:29 EDT
mock-1.2.18-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-de15171a43
Comment 16 Fedora Update System 2016-06-10 09:14:49 EDT
mock-1.2.18-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-9e2f372208
Comment 17 Fedora Update System 2016-06-10 13:59:37 EDT
mock-1.2.18-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-70cdc0c410
Comment 18 Fedora Update System 2016-06-10 23:18:18 EDT
mock-1.2.18-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-9e2f372208
Comment 19 Fedora Update System 2016-06-10 23:19:00 EDT
mock-1.2.18-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-3d9f899f6a
Comment 20 Fedora Update System 2016-06-10 23:53:23 EDT
mock-1.2.16-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-89209fd48b
Comment 21 Fedora Update System 2016-06-10 23:53:58 EDT
mock-1.2.18-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-de15171a43
Comment 22 Fedora Update System 2016-06-13 00:55:44 EDT
mock-1.2.18-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 23 Vedran Miletić 2016-06-16 18:39:55 EDT
Thanks!
Comment 24 Fedora Update System 2016-06-18 14:34:04 EDT
mock-1.2.18-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 25 Fedora Update System 2016-06-27 15:48:26 EDT
mock-1.2.18-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.
Comment 26 Fedora Update System 2016-06-27 23:19:12 EDT
mock-1.2.18-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
Comment 27 Miroslav Suchý 2016-08-08 17:20:15 EDT
*** Bug 1183454 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.