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

LocalShell runner fails on "No such file or directory" #7269

Closed
vholer opened this issue Jan 25, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@vholer
Copy link

commented Jan 25, 2019

When LocalShell is directly used to run Slurm CLI commands, the execution of the commands fails on "no such file or directory"

galaxy.jobs.runners.cli DEBUG 2019-01-25 19:13:53,789 [p:3868,w:1,m:0] [ShellRunner.work_thread-0] (5) submitting file: /opt/galaxy/database/jobs_directory/000/5/galaxy_5.s
h
galaxy.jobs.runners ERROR 2019-01-25 19:13:53,964 [p:3868,w:1,m:0] [ShellRunner.work_thread-0] (5) Unhandled exception calling queue_job
Traceback (most recent call last):
  File "lib/galaxy/jobs/runners/__init__.py", line 113, in run_next
    method(arg)
  File "lib/galaxy/jobs/runners/cli.py", line 98, in queue_job
    returncode, stdout = self.submit(shell, job_interface, ajs.job_file, galaxy_id_tag, retry=MAX_SUBMIT_RETRY)
  File "lib/galaxy/jobs/runners/cli.py", line 130, in submit
    cmd_out = shell.execute(job_interface.submit(job_file))
  File "lib/galaxy/jobs/runners/util/cli/shell/local.py", line 47, in execute
    p = Popen(cmd, stdin=None, stdout=outf, stderr=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

as the Popen function call inside LocalShell.execute gets whole command including arguments as a single string cmd (e.g.: 'sbatch /opt/galaxy/database/jobs_directory/000/6/galaxy_6.sh'):

def execute(self, cmd, persist=False, timeout=DEFAULT_TIMEOUT, timeout_check_interval=DEFAULT_TIMEOUT_CHECK_INTERVAL, **kwds):
outf = TemporaryFile()
p = Popen(cmd, stdin=None, stdout=outf, stderr=PIPE)

@mvdbeek mvdbeek added the kind/bug label Feb 5, 2019

mvdbeek added a commit to mvdbeek/galaxy that referenced this issue Mar 1, 2019

Fix LocalShellRunner
All the `cmd` coming from the plugins are strings, so I'm just doing
shlex.split here, which should be sufficient to bring this on par
with the Remote Shell plugins (which consume strings).
Should fix galaxyproject#7269.

mvdbeek added a commit to mvdbeek/galaxy that referenced this issue Mar 1, 2019

Fix LocalShellRunner
All the `cmd` coming from the plugins are strings, so if cmd is
a string we use `shell=True`, brings this on par
with the Remote Shell plugins (which consume strings).
Should fix galaxyproject#7269.

@martenson martenson closed this Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.