Bug 1141506 - [abrt] mock: subprocess.py:1327:_execute_child:OSError: [Errno 2] No such file or directory
Summary: [abrt] mock: subprocess.py:1327:_execute_child:OSError: [Errno 2] No such fil...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:80c88b4c0c02997a84206e24c75...
: 1152484 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-14 08:05 UTC by Raphael Groner
Modified: 2014-10-21 09:59 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-21 09:57:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (2.07 KB, text/plain)
2014-09-14 08:05 UTC, Raphael Groner
no flags Details
File: environ (178 bytes, text/plain)
2014-09-14 08:05 UTC, Raphael Groner
no flags Details
fedora-review.log with mock crash (34.14 KB, text/plain)
2014-09-14 08:17 UTC, Raphael Groner
no flags Details

Description Raphael Groner 2014-09-14 08:05:48 UTC
Description of problem:
doing a fedora-review -rn <srpm>

Version-Release number of selected component:
mock-1.1.41-1.fc20

Additional info:
reporter:       libreport-2.2.3
cmdline:        /usr/bin/python -tt /usr/sbin/mock --no-cleanup-after --no-clean --resultdir=/home/build/rpmbuild/dreamchess/results --quiet --shell 'rpm --eval \\\"%{_libdir}\\\"'
dso_list:       python-libs-2.7.5-13.fc20.x86_64
executable:     /usr/sbin/mock
kernel:         3.16.2-200.fc20.x86_64
type:           Python
uid:            0

Truncated backtrace:
subprocess.py:1327:_execute_child:OSError: [Errno 2] No such file or directory

Traceback (most recent call last):
  File "/usr/sbin/mock", line 306, in <module>
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 570, in main
    sys.exit(chroot.shell(options, cmd))
  File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 815, in shell
    cmd=cmd)
  File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 428, in doshell
    return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True)
  File "/usr/lib64/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Local variables in innermost frame:
errread: None
c2pread: None
gc_was_enabled: True
errwrite: None
shell: True
errpipe_write: 6
to_close: set([])
close_fds: False
self: <subprocess.Popen object at 0xcf1b10>
env: {'LANG': 'de_DE.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'echo -n "<mock-chroot>"', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
cwd: None
child_exception: OSError(2, 'No such file or directory')
args: ['/bin/sh', '-c', '/bin/bash -c "rpm --eval \\"%{_libdir}\\""']
executable: '/bin/sh'
c2pwrite: None
data: 'cexceptions\nOSError\np0\n(I2\nS\'No such file or directory\'\np1\ntp2\nRp3\n(dp4\nS\'child_traceback\'\np5\nS\'Traceback (most recent call last):\\n  File "/usr/lib64/python2.7/subprocess.py", line 1284, in _execute_child\\n  File "/usr/lib64/python2.7/os.py", line 353, in execvpe\\n  File "/usr/lib64/python2.7/os.py", line 368, in _execvpe\\nOSError: [Errno 2] No such file or directory\\n\'\np6\nsb.'
creationflags: 0
errpipe_read: 5
preexec_fn: <mockbuild.util.ChildPreExec object at 0xcf1ad0>
p2cread: None
startupinfo: None
p2cwrite: None
_close_in_parent: <function _close_in_parent at 0xc78e60>
universal_newlines: False

Comment 1 Raphael Groner 2014-09-14 08:05:52 UTC
Created attachment 937291 [details]
File: backtrace

Comment 2 Raphael Groner 2014-09-14 08:05:54 UTC
Created attachment 937292 [details]
File: environ

Comment 3 Raphael Groner 2014-09-14 08:17:07 UTC
Created attachment 937293 [details]
fedora-review.log with mock crash

fedora-review -rn <package>.srpm

Comment 4 Michael Simacek 2014-10-16 15:17:37 UTC
Can you reproduce it with mock-1.2 that's available in rawhide (installs fine on f20)? It has additional mechanisms to reinitialize incorrectly inited buildroot

Comment 5 Miroslav Suchý 2014-10-16 15:52:25 UTC
Here is repo for Fedora20 as well:
https://copr.fedoraproject.org/coprs/msuchy/mock-dev/

Comment 6 Damian Wrobel 2014-10-21 09:04:57 UTC
I've faced the same issue. I installed mock-1.2 from the aforementioned copr and while running it produces the error as following:

ERROR: Command failed. See logs for output.
 # /usr/bin/yum --installroot /var/lib/mock/fedora-20-x86_64/root --releasever 20 install @buildsys-build
INFO: Re-initializing mock build root
INFO: Init command returned error code 1
ERROR: Command failed. See logs for output.
 # /usr/bin/yum --installroot /var/lib/mock/fedora-20-x86_64/root --releasever 20 install @buildsys-build
ERROR: Exception down the road...(logs in /home/D.Wrobel/.cache/fedora-review.log)


excerpt from fedora-review.log:

Invalid GPG Key from file:///etc/pki/mock/RPM-GPG-KEY-fedora-20-primary: No key found in given key data
 None
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 491, in init
    self._rpm_eval('%{_libdir}')
  File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 259, in _rpm_eval
    return check_output(cmd).decode('utf-8').strip()
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['mock', '--no-cleanup-after', '--no-clean', '--resultdir=/home/D.Wrobel/tmp/gnutls/gnutls/results', '--quiet', '--shell', 'rpm --eval \\"%{_libdir}\\"']' returned non-zero exit status 1
10-21 10:04 root         INFO     Init command returned error code 1
10-21 10:04 root         DEBUG    Url download completed: 13.581
10-21 10:04 root         DEBUG    Exception down the road...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 232, in run
    self._do_run(outfile)
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 222, in _do_run
    self._do_report(outfile)
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 96, in _do_report
    self._run_checks(self.bug.spec_file, self.bug.srpm_file, outfile)
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 105, in _run_checks
    self.checks = Checks(spec, srpm)
  File "/usr/lib/python2.7/site-packages/FedoraReview/checks.py", line 271, in __init__
    self.spec = SpecFile(spec_file, self.flags)
  File "/usr/lib/python2.7/site-packages/FedoraReview/spec_file.py", line 91, in __init__
    update_macros()
  File "/usr/lib/python2.7/site-packages/FedoraReview/spec_file.py", line 65, in update_macros
    expanded = Mock.get_macro(macro, self, flags)
  File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 346, in get_macro
    self._macros = self._get_default_macros()
  File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 134, in _get_default_macros
    values = self._rpm_eval(tags).split()
  File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 259, in _rpm_eval
    return check_output(cmd).decode('utf-8').strip()
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)


However using mock-1.2 directly seems to work properly.

Comment 7 Miroslav Suchý 2014-10-21 09:48:44 UTC
#6 looks to me as just some networking problem during initialization of chroot using yum. And yes, fedora-review should handle that more gracefully. (filed as bug 1155032)

Comment 8 Miroslav Suchý 2014-10-21 09:57:59 UTC
The reproducer from #0
  mock -r fedora-20-x86_64 --no-cleanup-after --no-clean --resultdir=/tmp --quiet --shell 'rpm --eval \\\"%{_libdir}\\\"'
works for me (with mock-1.2).

Therefore I hope this is fixed in mock-1.2. If my hope is false, then feel free to reopen this bug.

Comment 9 Miroslav Suchý 2014-10-21 09:59:42 UTC
*** Bug 1152484 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.