Bug 1305367 - Non-fatal POSTIN scriptlet failure in rpm package mock
Summary: Non-fatal POSTIN scriptlet failure in rpm package mock
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 24
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1183454 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-07 17:12 UTC by Vedran Miletić
Modified: 2016-08-08 21:20 UTC (History)
9 users (show)

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:
Clone Of:
Environment:
Last Closed: 2016-06-13 04:55:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vedran Miletić 2016-02-07 17:12:19 UTC
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 16:30:32 UTC
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 17:50:59 UTC
$ 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 18:40:39 UTC
You do not have /etc/mock directory? That is weird because mock ship it.

Comment 4 Vedran Miletić 2016-02-17 18:44:02 UTC
I have it after installation, of course.

Comment 5 Miroslav Suchý 2016-02-17 18:58:13 UTC
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 15:44:46 UTC
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 23:36:51 UTC
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 06:32:32 UTC
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 12:48:14 UTC
(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 08:30:57 UTC
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 13:39:46 UTC
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 13:13:27 UTC
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 13:13:50 UTC
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 13:14:10 UTC
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 13:14:29 UTC
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 13:14:49 UTC
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 17:59:37 UTC
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-11 03:18:18 UTC
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-11 03:19:00 UTC
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-11 03:53:23 UTC
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-11 03:53:58 UTC
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 04:55:44 UTC
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 22:39:55 UTC
Thanks!

Comment 24 Fedora Update System 2016-06-18 18:34:04 UTC
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 19:48:26 UTC
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-28 03:19:12 UTC
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 21:20:15 UTC
*** 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.