common-workflow-language / common-workflow-language/cwltool

CWLProv: cannot reproduce workflow runs with Directory input

Open
#1,693 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

**cwltool version: 3.1.20220628170238**

Ran [this workflow](https://github.com/RenskeW/cwlprov-provenance/tree/f5dd87a950eeaf7f96bd39dc218164832ff3cbea/prov_data_annotations/example2) by @RenskeW with:

```console
$ cwltool --provenance ro wf.cwl wf_job.yml
```

Then I tried reproducing the run and I got this error:

```console
$ cd ro/workflow/
$ cwltool --debug packed.cwl primary-job.json
INFO /home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/bin/cwltool 3.1.20220628170238
INFO Resolved 'packed.cwl' to 'file:///home/simleo/repos/cwlprov-provenance/prov_data_annotations/example2/ro/workflow/packed.cwl'
ERROR Input object failed validation:
Anonymous directory object must have 'listing' and 'basename' fields.
Traceback (most recent call last):
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/main.py", line 1307, in main
initialized_job_order_object = init_job_order(
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/main.py", line 507, in init_job_order
normalizeFilesDirs(job_order_object)
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/utils.py", line 474, in normalizeFilesDirs
visit_class(job, ("File", "Directory"), addLocation)
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/utils.py", line 216, in visit_class
visit_class(rec[d], cls, op)
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/utils.py", line 214, in visit_class
op(rec)
File "/home/simleo/git/workflow-run-crate/tools/cwlprov_to_crate/venv/lib/python3.8/site-packages/cwltool/utils.py", line 434, in addLocation
raise ValidationException(
schema_salad.exceptions.ValidationException: Anonymous directory object must have 'listing' and 'basename' fields.
```

I also had problems with [this other workflow](https://github.com/ResearchObject/workflow-run-crate/tree/a3361b4b4a4939ffeb3ecd85d64bc63ed0be0337/tools/cwlprov_to_crate/grepucase). For each file in the input directory, it does a grep for the given pattern, converts the result to upper case and writes the final result to a file in the output directory.

```console
$ cwltool --provenance ro grepucase.cwl grepucase-job.yml
$ head grepucase_in/*
==> grepucase_in/bar <==
the fat
brown bear
jumped over
the lazy whale

==> grepucase_in/foo <==
the quick
brown fox
jumped over
the lazy dog
$ head ucase_out/*
==> ucase_out/bar.out.out <==
THE LAZY WHALE

==> ucase_out/foo.out.out <==
THE LAZY DOG
```

In this case, running the workflow from the RO does not cause any errors, but the output directory is empty.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.