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

--tmpdir-prefix argument not checked for trailing delimiter #1860

Open
sjaenick opened this issue Jun 13, 2023 · 0 comments
Open

--tmpdir-prefix argument not checked for trailing delimiter #1860

sjaenick opened this issue Jun 13, 2023 · 0 comments

Comments

@sjaenick
Copy link

sjaenick commented Jun 13, 2023

$ cwltool --version
/vol/mgx-sw/bin/cwltool 3.1.20230425144158

When invoked with --tmpdir-prefix /vol/sge-tmp (a directory), cwltool doesn't add a trailing slash, and workflow
execution fails:

ERROR Unexpected exception
Traceback (most recent call last):
  File "/vol/mgx-sw/lib/venvs/cwltool/lib/python3.11/site-packages/cwltool/workflow.py", line 459, in job
    yield from self.embedded_tool.job(
  File "/vol/mgx-sw/lib/venvs/cwltool/lib/python3.11/site-packages/cwltool/command_line_tool.py", line 960, in job
    builder = self._init_job(job_order, runtimeContext)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vol/mgx-sw/lib/venvs/cwltool/lib/python3.11/site-packages/cwltool/process.py", line 857, in _init_job
    tmpdir = fs_access.realpath(runtime_context.get_tmpdir())
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vol/mgx-sw/lib/venvs/cwltool/lib/python3.11/site-packages/cwltool/context.py", line 215, in get_tmpdir
    return self.create_tmpdir()
           ^^^^^^^^^^^^^^^^^^^^
  File "/vol/mgx-sw/lib/venvs/cwltool/lib/python3.11/site-packages/cwltool/context.py", line 227, in create_tmpdir
    return tempfile.mkdtemp(prefix=tmp_prefix, dir=tmp_dir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/vol/mgx-sw/lib/python3.11/tempfile.py", line 368, in mkdtemp
    _os.mkdir(file, 0o700)
PermissionError: [Errno 13] Permission denied: '/vol/sge-tmpv4nl9n8x'
ERROR Cannot make scatter job: [Errno 13] Permission denied: '/vol/sge-tmpv4nl9n8x'

I just discussed this with @mr-c, and he suggested to provide a better error message to create_tmpdir() in cwltool.context,
i.e. suggesting to either adding a trailing slash to the argument or to check for write permissions.

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

1 participant