Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1139276

Summary: when building mockroot $PATH may not be set for %post
Product: Red Hat Enterprise Linux 7 Reporter: Pat Riehecky <riehecky>
Component: pamAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.0CC: csieh, dapospis, misterbonnie, riehecky
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pam-1.1.8-11.el7 Doc Type: Bug Fix
Doc Text:
no doc text needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 10:25:55 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:
Attachments:
Description Flags
patch to resolve
none
mock config for replication none

Description Pat Riehecky 2014-09-08 14:13:58 UTC
Created attachment 935361 [details]
patch to resolve

Description of problem: when setting up a mockroot, $PATH may not be set for %post which results in an error in the logs.  Using %{_bindir} to set path to install prevents this error


Version-Release number of selected component (if applicable):


How reproducible:100


Steps to Reproduce:
1.build a RHEL7 mockbuild root, look for errors in root.log
2.
3.

Actual results:
DEBUG util.py:283:  /var/tmp/rpm-tmp.6T2Ig8: line 3: install: command not found
DEBUG util.py:283:  warning: %post(pam-1.1.8-9.el7.x86_64) scriptlet failed, exit status 127
DEBUG util.py:283:  Non-fatal POSTIN scriptlet failure in rpm package pam-1.1.8-9.el7.i686

Expected results:
no errors

Additional info:
attached patch resolves using standard rpm macros

Comment 4 Dalibor Pospíšil 2014-10-11 22:06:29 UTC
I am not able to reproduce this issue. Even the reported version build without any error in my RHEL7 VM. Is there something what I could do to make it fail?

Comment 5 Pat Riehecky 2014-10-13 13:51:36 UTC
I get it 100% of the time on an EL7 host running mock building an EL7 changeroot.

I've been using mock-1.1.41-2.el7 from EPEL.  I'll attach a mock config I can replicate the problem with.

Comment 6 Pat Riehecky 2014-10-13 13:51:56 UTC
Created attachment 946396 [details]
mock config for replication

Comment 7 Dalibor Pospíšil 2014-10-23 14:35:15 UTC
I still cannot get reproduction. I have no deep knowledge of mock.
With the config of yours I get missing useradd in chroot and with modified your config + my repos I get correct build without errors.

Actually I tried to use following config. Could you identify what needs to be changed? 

# Auto-generated by the Koji build system
config_opts['environment']['LANG'] = os.environ.setdefault('LANG', 'en_US.UTF-8')
config_opts['environment']['TZ'] = os.environ.setdefault('TZ', 'CST6CDT')

config_opts['chroothome'] = '/builddir'
config_opts['use_host_resolv'] = False
config_opts['basedir'] = '/var/lib/mock'
config_opts['rpmbuild_timeout'] = 86400

config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['yum_cache_enable'] = False
config_opts['plugin_conf']['ccache_enable'] = False

config_opts['macros']['%_host'] = 'x86_64-koji-linux-gnu'
config_opts['macros']['%_host_cpu'] = 'x86_64'
config_opts['macros']['%vendor'] = 'Koji'
config_opts['macros']['%distribution'] = 'Koji Testing'
config_opts['macros']['%_topdir'] = '/builddir/build'
config_opts['macros']['%_rpmfilename'] = '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
config_opts['macros']['%packager'] = 'Koji'

config_opts['root'] = 'mockbuild-library'
config_opts['target_arch'] = 'x86_64'
config_opts['chroot_setup_cmd'] = 'install @build @base @development '
config_opts['dist'] = 'el7'  # only useful for --resultdir variable subst


config_opts['yum.conf'] = """
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1

# repos
...

Comment 8 Pat Riehecky 2014-10-23 14:55:39 UTC
Try:

config_opts['chroot_setup_cmd'] = 'install @build @base @core @development'


In theory @core should be automatic, but being explicit can sometimes help clear things up.

Comment 9 Dalibor Pospíšil 2014-10-24 11:35:34 UTC
Still no luck with reproducing the issue. After a discussion with devel I decided to leave the bug verified as SanityOnly. This means the change is in place so the scripts now use absolute paths.

Comment 10 Pat Riehecky 2014-10-24 13:04:04 UTC
That works for me.

Comment 13 errata-xmlrpc 2015-03-05 10:25:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0453.html