Bug 957992

Summary: [abrt] mock-1.1.32-1.fc20: subprocess.py:1308:_execute_child:OSError: [Errno 2] No such file or directory
Product: [Fedora] Fedora Reporter: Christopher Meng <i>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: i, mebrown, robinlee.sysu, williams
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:a1d02c0dfe1558f2e7678baed61335cc9c290db8
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-04 07:31:00 UTC Type: ---
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
File: backtrace
none
File: core_backtrace
none
File: environ none

Description Christopher Meng 2013-04-30 04:30:00 UTC
Description of problem:
usermod -a -G mock rpmaker(My account for RPM creating)

Then exit root and run command as rpmaker:

[rpmaker@fab ~]$ mock shell
INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
Start: lock buildroot
Start: device setup
Finish: device setup
Start: shell
Finish: shell
Traceback (most recent call last):
  File "/usr/sbin/mock", line 561, in <module>
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 822, in main
    sys.exit(chroot.shell(options, cmd))
  File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 765, in shell
    cmd=cmd)
  File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 409, in doshell
    return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

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

Additional info:
cmdline:        /usr/bin/python -tt /usr/sbin/mock shell
dso_list:       python-libs-2.7.4-3.fc20.i686
executable:     /usr/sbin/mock
kernel:         3.9.0-2.fc20.i686.PAE
runlevel:       N 5
uid:            0
ureports_counter: 1

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

Traceback (most recent call last):
  File "/usr/sbin/mock", line 561, in <module>
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 822, in main
    sys.exit(chroot.shell(options, cmd))
  File "/usr/lib/python2.7/site-packages/mockbuild/backend.py", line 765, in shell
    cmd=cmd)
  File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 409, in doshell
    return subprocess.call(cmdstr, preexec_fn=preexec, env=environ, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1308, 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
executable: '/bin/sh'
close_fds: False
self: <subprocess.Popen object at 0x95f7f6c>
env: {'LANG': 'en_US.utf8', '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 -i -l']
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/lib/python2.7/subprocess.py", line 1265, in _execute_child\\n  File "/usr/lib/python2.7/os.py", line 353, in execvpe\\n  File "/usr/lib/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 0x95f7f0c>
p2cread: None
startupinfo: None
p2cwrite: None
universal_newlines: False

Comment 1 Christopher Meng 2013-04-30 04:30:04 UTC
Created attachment 741754 [details]
File: backtrace

Comment 2 Christopher Meng 2013-04-30 04:30:09 UTC
Created attachment 741755 [details]
File: core_backtrace

Comment 3 Christopher Meng 2013-04-30 04:30:11 UTC
Created attachment 741756 [details]
File: environ

Comment 4 Christopher Meng 2013-05-07 08:35:12 UTC
This bug prevented me from fedora-review.

Comment 5 Robin Lee 2013-05-07 09:51:03 UTC
How did you init the mock environment? With which configuration?
I can't reproduce this with mock-1.1.29-1.fc18.noarch on Fedora 18 x86_64.

Comment 6 Christopher Meng 2013-05-08 01:41:20 UTC
(In reply to comment #5)
> How did you init the mock environment? With which configuration?
> I can't reproduce this with mock-1.1.29-1.fc18.noarch on Fedora 18 x86_64.

# usermod -a -G mock rpmaker && newgrp mock

$ id
uid=1000(rpmaker) gid=1000(rpmaker) groups=1000(rpmaker),987(mock)

Comment 7 Robin Lee 2013-05-08 02:18:41 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > How did you init the mock environment? With which configuration?
> > I can't reproduce this with mock-1.1.29-1.fc18.noarch on Fedora 18 x86_64.
> 
> # usermod -a -G mock rpmaker && newgrp mock
> 
> $ id
> uid=1000(rpmaker) gid=1000(rpmaker) groups=1000(rpmaker),987(mock)

Usually you would run 'mock init' or something like that before you can chroot into the Mock environment.

Comment 8 Christopher Meng 2013-05-08 07:48:01 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > How did you init the mock environment? With which configuration?
> > > I can't reproduce this with mock-1.1.29-1.fc18.noarch on Fedora 18 x86_64.
> > 
> > # usermod -a -G mock rpmaker && newgrp mock
> > 
> > $ id
> > uid=1000(rpmaker) gid=1000(rpmaker) groups=1000(rpmaker),987(mock)
> 
> Usually you would run 'mock init' or something like that before you can
> chroot into the Mock environment.

Fixed by mock init.

Thanks Robin!

Comment 9 Christopher Meng 2013-12-20 04:34:08 UTC
No, I think now this may be a bug here, seems we need to mock --cleanup and then init again. I think there may have some unfinished jobs and leftovers caused this.

Comment 10 Clark Williams 2014-01-03 18:59:48 UTC
is 'bash' installed on this system? I'm trying to figure out why we get a "no such file or directory" from the subprocess module and one thing that would do it is if /bin/bash doesn't exist.

Comment 11 Christopher Meng 2014-01-04 07:31:00 UTC
(In reply to Clark Williams from comment #10)
> is 'bash' installed on this system? I'm trying to figure out why we get a
> "no such file or directory" from the subprocess module and one thing that
> would do it is if /bin/bash doesn't exist.

I got this problems a week ago, at that time libselinux has 2 updates and the first one caused many disasters. Roughly summary is that libselinux mess up with different modes.

Now selinux is working fine here. This bug can be closed.