Bug 1362478

Summary: package state plugin error: SubprocessError
Product: [Fedora] Fedora Reporter: Mikhail Campos <Mikhail_Campos-Guadamuz>
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: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mock-1.2.19-2.fc24 mock-1.2.20-1.el6 mock-1.2.20-1.el7 mock-1.2.20-1.fc25 mock-1.2.20-1.fc23 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-03 02:17:56 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
build.log
none
use correct drop/restore privs in package state plugin
none
use context manager for dropPrivsTemp()/restorePrivs() none

Description Mikhail Campos 2016-08-02 10:25:47 UTC
Created attachment 1186738 [details]
build.log

Description of problem:
When config_opts['plugin_conf']['package_state_enable'] = True, mock fails with the following error:

[...]
  File "/usr/lib/python3.5/site-packages/mockbuild/buildroot.py", line 189, in doChroot
    env=env, shell=shell, *args, **kargs)
  File "/usr/lib/python3.5/site-packages/mockbuild/trace_decorator.py", line 88, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.5/site-packages/mockbuild/util.py", line 512, in do
    preexec_fn=preexec,
  File "/usr/lib64/python3.5/subprocess.py", line 950, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.5/subprocess.py", line 1545, in _execute_child
    raise child_exception_type(err_msg)
subprocess.SubprocessError: Exception occurred in preexec_fn.

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

How reproducible:
Always

Steps to Reproduce:
1. config_opts['plugin_conf']['package_state_enable'] = True
2. mock package.src.rpm

Actual results:
subprocess.SubprocessError: Exception occurred in preexec_fn.

Expected results:
No errors

Comment 1 Mikhail Campos 2016-08-02 16:22:19 UTC
Created attachment 1186866 [details]
use correct drop/restore privs in package state plugin

Proposed patch attached

Comment 2 Mikhail Campos 2016-08-02 16:24:45 UTC
Created attachment 1186867 [details]
use context manager for dropPrivsTemp()/restorePrivs()

Alternative patch attached

Comment 3 Miroslav Suchý 2016-08-08 12:06:14 UTC
This is very nice refactoring. Thank you a lot.
Committed as:
* de19195 (HEAD -> devel, origin/devel) Use context manager for drop/restore calls of uid manager [RHBZ#1362478]

Comment 4 Fedora Update System 2016-08-10 13:58:26 UTC
mock-1.2.19-2.fc23 distribution-gpg-keys-1.5-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6ba1c57742

Comment 5 Fedora Update System 2016-08-10 13:59:00 UTC
mock-1.2.19-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7a569517fe

Comment 6 Fedora Update System 2016-08-10 13:59:34 UTC
mock-1.2.19-2.fc24 distribution-gpg-keys-1.5-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-497b37d2bc

Comment 7 Fedora Update System 2016-08-10 14:00:08 UTC
mock-1.2.19-2.el7 distribution-gpg-keys-1.5-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-2b233647a0

Comment 8 Fedora Update System 2016-08-10 14:00:44 UTC
mock-1.2.19-2.el6 distribution-gpg-keys-1.5-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-6b161941e5

Comment 9 Fedora Update System 2016-08-10 18:54:45 UTC
mock-1.2.19-2.fc25 has been pushed to the Fedora 25 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-7a569517fe

Comment 10 Fedora Update System 2016-08-10 19:52:49 UTC
distribution-gpg-keys-1.5-1.fc23, mock-1.2.19-2.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-6ba1c57742

Comment 11 Fedora Update System 2016-08-11 03:23:54 UTC
distribution-gpg-keys-1.5-1.fc24, mock-1.2.19-2.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-497b37d2bc

Comment 12 Fedora Update System 2016-08-11 14:16:02 UTC
distribution-gpg-keys-1.5-1.el6, mock-1.2.19-2.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-6b161941e5

Comment 13 Fedora Update System 2016-08-11 14:20:12 UTC
distribution-gpg-keys-1.5-1.el7, mock-1.2.19-2.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-2b233647a0

Comment 14 Fedora Update System 2016-08-15 21:25:12 UTC
distribution-gpg-keys-1.5-1.fc24, mock-1.2.19-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2016-08-17 09:42:27 UTC
distribution-gpg-keys-1.5-1.fc23 mock-1.2.20-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6ba1c57742

Comment 16 Fedora Update System 2016-08-17 09:43:00 UTC
mock-1.2.20-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7a569517fe

Comment 17 Fedora Update System 2016-08-17 09:43:46 UTC
distribution-gpg-keys-1.5-1.el7 mock-1.2.20-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-2b233647a0

Comment 18 Fedora Update System 2016-08-17 09:44:20 UTC
distribution-gpg-keys-1.5-1.el6 mock-1.2.20-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-6b161941e5

Comment 19 Fedora Update System 2016-08-17 19:54:53 UTC
mock-1.2.20-1.fc25 has been pushed to the Fedora 25 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-7a569517fe

Comment 20 Fedora Update System 2016-08-18 01:51:44 UTC
distribution-gpg-keys-1.5-1.fc23, mock-1.2.20-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-6ba1c57742

Comment 21 Fedora Update System 2016-08-18 04:19:15 UTC
distribution-gpg-keys-1.5-1.el7, mock-1.2.20-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-2b233647a0

Comment 22 Fedora Update System 2016-08-18 04:19:27 UTC
distribution-gpg-keys-1.5-1.el6, mock-1.2.20-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-6b161941e5

Comment 23 Fedora Update System 2016-09-03 02:17:26 UTC
distribution-gpg-keys-1.5-1.el6, mock-1.2.20-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 24 Fedora Update System 2016-09-03 02:18:21 UTC
distribution-gpg-keys-1.5-1.el7, mock-1.2.20-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 25 Fedora Update System 2016-09-03 17:39:48 UTC
mock-1.2.20-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2016-09-06 02:20:19 UTC
distribution-gpg-keys-1.5-1.fc23, mock-1.2.20-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.