common-workflow-language / common-workflow-language/cwltool
Type mismatch between source and sink when using merge_nested for single-item list of input link
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
Hello!
Following example runs only one step which requires File [ ] to be set as an input. Workflow has two File inputs, which I combine using MultipleInputFeatureRequirement. The problem is that if I set only one file as input for the step, it causes an error.
Example that I tested https://github.com/michael-kotliar/cwl_sandbox/tree/master/mergedInput
To run: `cwl-runner --debug workflow.cwl workflow-job.yml`
**workflow.cwl**
``` yaml
cwlVersion: v1.0
class: Workflow
requirements:
- class: MultipleInputFeatureRequirement
inputs:
fileA:
type: File
fileB:
type: File
outputs:
FileC:
type: File
outputSource: concat/outputFile
steps:
concat:
run: ./concat.cwl
in:
files: [fileA] #PROBLEM IS HERE
out: [outputFile]
```
Output log:
```
/home/michael_kotliar/.local/bin/cwl-runner 1.0.20170224141733
Resolved 'workflow.cwl' to 'file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl'
[workflow workflow.cwl] initialized from file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl
[workflow workflow.cwl] workflow starting
[step concat] Cannot make job: Type mismatch between source 'file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl#fileA' (File) and sink 'file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl#concat/files' (ordereddict([('type', 'array'), ('items', 'File')]))
Traceback (most recent call last):
File "/home/michael_kotliar/python/lib/python2.7/site-packages/cwltool/workflow.py", line 391, in job
for newjob in step.iterable:
File "/home/michael_kotliar/python/lib/python2.7/site-packages/cwltool/workflow.py", line 264, in try_make_job
self.state, inputparms, False, supportsMultipleInput, "source")
File "/home/michael_kotliar/python/lib/python2.7/site-packages/cwltool/workflow.py", line 174, in object_from_state
inp["type"]))
WorkflowException: Type mismatch between source 'file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl#fileA' (File) and sink 'file:///mnt/data/HOME/michael_kotliar/workspaces/cwl_ws/cwl_sandbox/mergedInput/workflow.cwl#concat/files' (ordereddict([('type', 'array'), ('items', 'File')]))
[workflow workflow.cwl] outdir is /tmp/tmpRuDcKs
Removing intermediate output directory /tmp/tmpRuDcKs
{}
Final process status is permanentFail
```
Contributor guide
Assessment
This issue has not been assessed yet.