Renku rerun/update: permission error

Hi,

I have set up a simple workflow that runs a shell script to create a json file from a bash array.
The workflow has been generated by running:

renku run --input ${input_script.sh} -- ${input_script.sh} ${out_json}

This command runs fine and creates the desired json file.
When I want to update the json file, by changing the bash array in ${input_script} and running

renku update -a

or by simply rerunning the workflow using:

renku rerun ${out-json}

I get this CWL error:

...
PermissionError: [Errno 13] Permission denied: ''
ERROR:cwltool:Exception while running job
Traceback (most recent call last):
  File "/home/jovyan/.local/pipx/venvs/renku/lib/python3.8/site-packages/cwltool/job.py", line 373, in _execute
    rcode = _job_popen(
  File "/home/jovyan/.local/pipx/venvs/renku/lib/python3.8/site-packages/cwltool/job.py", line 939, in _job_popen
    sproc = subprocess.Popen(
  File "/opt/conda/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/conda/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: ''
[job 2042118b-30bb-4955-b619-6c615072f355] completed permanentFail
WARNING:cwltool:[job 2042118b-30bb-4955-b619-6c615072f355] completed permanentFail
Error: Unable to finish re-executing workflow; check the workflow execution outline above and the generated /tmp/tmp5u19stjy/01cee7a2-c4e1-496a-8933-e1994c5d8a4c.cwl file for potential issues, then remove the /tmp/tmp5u19stjy/01cee7a2-c4e1-496a-8933-e1994c5d8a4c.cwl file and try again

I have given all permissions to ${input_script.sh} using chmod 777, but the error persists and I’m wondering if there is something else I miss?
I have set up a minimal example of this here. Also this project contains a similar (althought more complex) setup with an R script to create a data file as input to a renku workflow, but here updating/rerunning works fine.

Best,
Almut

Just in case this is the cwl output from the tmp location mentioned in the error message:

#!/usr/bin/env cwl-runner

baseCommand:
- ''
class: CommandLineTool
cwlVersion: v1.0
id: 2042118b-30bb-4955-b619-6c615072f355
inputs:
- default: out/test_file.json
  id: outputs_2_arg
  inputBinding:
    position: 2
  type: string
- default:
    class: File
    path: /work/test-workflow-update/src/generate_test_file.sh
  id: inputs_1
  inputBinding:
    position: 1
  type: File
- default:
    class: Directory
    path: /work/test-workflow-update/.renku
  id: input_renku_metadata
  type: Directory
- default:
    class: Directory
    path: /work/test-workflow-update/.git
  id: input_git_directory
  type: Directory
outputs:
- id: outputs_2
  outputBinding:
    glob: $(inputs.outputs_2_arg)
  type: File
requirements:
  InitialWorkDirRequirement:
    listing:
    - entry: '$({"listing": [], "class": "Directory"})'
      entryname: out
      writable: true
    - entry: $(inputs.inputs_1)
      entryname: src/generate_test_file.sh
      writable: false
    - entry: $(inputs.input_renku_metadata)
      entryname: .renku
      writable: false
    - entry: $(inputs.input_git_directory)
      entryname: .git
      writable: false
  InlineJavascriptRequirement: {}

Hi Almut.

Thank you for raising this. In fact I personally ran into this a couple of times myself.

The problem is in the parsing of the arguments piped to renku run. If you are running a bash script, you need to add bash as the COMMAND in
renku run COMMAND script.sh instead of simply renku run script.sh.

Essentially renku is currently parsing the space as an executable called '' which obviously doesn’t exist and hence it complains of a Permission error.

Would you be able to try again by first running

renku run --input ${input_script.sh} -- bash ${input_script.sh} ${out_json}

and then running renku update -a?

1 Like

Hi Almut,

could you please paste here the output of this command:

head -1 ${input_script.sh}

i.e. the first line of the script itself.

Hi @vigsterkr

The first line is:

#!/usr/bin/env bash

Hi @gavin and @vigsterkr I’m sorry I just saw Gavins post.
Thanks a lot! That in deed solves it! :tada: