# Renku rerun/update: permission error

**URL:** <https://renku.discourse.group/t/renku-rerun-update-permission-error/349>\
**Category:** Renku (CLI)\
**Created:** [18 June 2021 09:33 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349 "2021-06-18T09:33:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almut](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/almut/32/184_2.png) [@Almut](https://renku.discourse.group/u/Almut)\
**Post date:** [18 June 2021 09:33 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/1 "2021-06-18T09:33:30Z")

</div>

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:

```auto
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

```auto
renku update -a

```

or by simply rerunning the workflow using:

```auto
renku rerun ${out-json}

```

I get this CWL error:

```auto
...
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](https://renkulab.io/projects/almut.lue/test-workflow-update). Also [this](https://renkulab.io/projects/omnibenchmark/omni_data/csf-patients) 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

---

<div class="post-metadata">

**Author:** ![Almut](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/almut/32/184_2.png) [@Almut](https://renku.discourse.group/u/Almut)\
**Post date:** [18 June 2021 09:35 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/2 "2021-06-18T09:35:25Z")

</div>

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

```auto
#!/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: {}

```

---

<div class="post-metadata">

**Author:** ![gavin-k-lee](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/gavin-k-lee/32/233_2.png) [@gavin-k-lee](https://renku.discourse.group/u/gavin-k-lee)\
**Post date:** [18 June 2021 09:44 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/3 "2021-06-18T09:44:56Z")

</div>

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`?

---

<div class="post-metadata">

**Author:** ![vigsterkr](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/vigsterkr/32/267_2.png) [@vigsterkr](https://renku.discourse.group/u/vigsterkr)\
**Post date:** [18 June 2021 09:47 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/4 "2021-06-18T09:47:38Z")

</div>

Hi Almut,

could you please paste here the output of this command:

```auto
head -1 ${input_script.sh}

```

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

---

<div class="post-metadata">

**Author:** ![Almut](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/almut/32/184_2.png) [@Almut](https://renku.discourse.group/u/Almut)\
**Post date:** [18 June 2021 09:54 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/5 "2021-06-18T09:54:18Z")

</div>

Hi @vigsterkr

The first line is:

```auto
#!/usr/bin/env bash

```

---

<div class="post-metadata">

**Author:** ![Almut](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/almut/32/184_2.png) [@Almut](https://renku.discourse.group/u/Almut)\
**Post date:** [18 June 2021 12:50 UTC](https://renku.discourse.group/t/renku-rerun-update-permission-error/349/6 "2021-06-18T12:50:48Z")

</div>

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