Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange error calling sandboxlib on Fedora 22 on Scaleways ARM server... #11

Open
devcurmudgeon opened this issue Aug 31, 2015 · 1 comment

Comments

@devcurmudgeon
Copy link
Member

Traceback (most recent call last):
File "../ybd/ybd.py", line 41, in
sandbox.executor = sandboxlib.executor_for_platform()
File "/usr/lib/python2.7/site-packages/sandboxlib/init.py", line 175, in executor_for_platform
program = sandboxlib.linux_user_chroot.linux_user_chroot_program()
File "/usr/lib/python2.7/site-packages/sandboxlib/linux_user_chroot.py", line 276, in linux_user_chroot_program
return sandboxlib.utils.find_program('linux-user-chroot')
File "/usr/lib/python2.7/site-packages/sandboxlib/utils.py", line 43, in find_program
program_path = subprocess.check_output(argv).strip()
File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, _popenargs, *_kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

basically 'which' doesn't exist on this system...

@richardmaw-codethink
Copy link

On Mon, Aug 31, 2015 at 02:28:11AM -0700, Paul Sherwood wrote:

Traceback (most recent call last):
File "../ybd/ybd.py", line 41, in
sandbox.executor = sandboxlib.executor_for_platform()
File "/usr/lib/python2.7/site-packages/sandboxlib/init.py", line 175, in executor_for_platform
program = sandboxlib.linux_user_chroot.linux_user_chroot_program()
File "/usr/lib/python2.7/site-packages/sandboxlib/linux_user_chroot.py", line 276, in linux_user_chroot_program
return sandboxlib.utils.find_program('linux-user-chroot')
File "/usr/lib/python2.7/site-packages/sandboxlib/utils.py", line 43, in find_program
program_path = subprocess.check_output(argv).strip()
File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, _popenargs, *_kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

That's odd. It looks like the which program isn't installed, and sandboxlib
only handles the target binary not existing, rather than the which program
not.

I'd suggest either installing which (which normally comes from busybox or
debianutils in my experience), or changing the code to fall back to something
like:

for execdir in search_path.split(':'):
    execpath = os.path.join(execdir, program_name)
    if os.path.exists(execpath):
        program_path = execpath
        break
else:
    program_path = None

If you want to make it more platform independent you'll need platform dependent
search_path parsing, but the existing implementation is already platform
dependent when falling back to which.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants