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

cwltool failure when mixing cwlVersion tools in a workflow #1321

Closed
pvanheus opened this issue Jul 9, 2020 · 2 comments
Closed

cwltool failure when mixing cwlVersion tools in a workflow #1321

pvanheus opened this issue Jul 9, 2020 · 2 comments

Comments

@pvanheus
Copy link
Contributor

pvanheus commented Jul 9, 2020


Expected Behavior

cwltool should be able to run a workflow with a mixture of cwlVersion 1.0 and cwlVersion 1.1 tools.

Actual Behavior

This repository contains 2 tools, BWA-Index.cwl and BWA-Mem.cwl and a workflow file. The workflow can be run from the test folder with e.g.

cwltool --debug ../index_and_map.cwl workflow_input.json

If both tools have cwlVersion: v1.1 or cwlVersion: v1.0 then the workflow completes successfully (this is with cwltool version 3.0.20200530110633 installed via conda.

If BWA-Index.cwl is set to cwlVersion: v1.0 while keeping BWA-Mem.cwl on cwlVersion: v1.1, the following error happens:

INFO /home/pvh/anaconda3/envs/cwltool/bin/cwltool 3.0.20200530110633
INFO Resolved '../index_and_map.cwl' to 'file:///home/pvh/Documents/code/SANBI/pvh-forks/cwl-index-and-map/index_and_map.cwl'
ERROR I'm sorry, I couldn't load this CWL file.
The error was: 
Traceback (most recent call last):
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/main.py", line 965, in main
    tool = make_tool(uri, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/load_tool.py", line 455, in make_tool
    tool = loadingContext.construct_tool_object(processobj, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/workflow.py", line 58, in default_make_tool
    return Workflow(toolpath_object, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/workflow.py", line 145, in __init__
    param_to_step,
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/checker.py", line 216, in static_checker
    for p in sink.get("secondaryFiles", [])
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/checker.py", line 217, in <listcomp>
    if p.get("required", True)
AttributeError: 'str' object has no attribute 'get'

If BWA-Index.cwl is set to cwlVersion: v1.1 and BWA-Mem.cwl is set to version v1.0 then the following error happens:

INFO /home/pvh/anaconda3/envs/cwltool/bin/cwltool 3.0.20200530110633
INFO Resolved '../index_and_map.cwl' to 'file:///home/pvh/Documents/code/SANBI/pvh-forks/cwl-index-and-map/index_and_map.cwl'
ERROR I'm sorry, I couldn't load this CWL file.
The error was: 
Traceback (most recent call last):
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/main.py", line 965, in main
    tool = make_tool(uri, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/load_tool.py", line 455, in make_tool
    tool = loadingContext.construct_tool_object(processobj, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/workflow.py", line 58, in default_make_tool
    return Workflow(toolpath_object, loadingContext)
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/workflow.py", line 145, in __init__
    param_to_step,
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/checker.py", line 222, in static_checker
    mylist = [p["pattern"] for p in src.get("secondaryFiles", [])]
  File "/home/pvh/anaconda3/envs/cwltool/lib/python3.7/site-packages/cwltool/checker.py", line 222, in <listcomp>
    mylist = [p["pattern"] for p in src.get("secondaryFiles", [])]
TypeError: string indices must be integers

Workflow Code

See: https://github.com/pvanheus/cwl-index-and-map

Full Traceback

See above

Your Environment

  • cwltool version: 3.0.20200530110633
@mr-c
Copy link
Member

mr-c commented Jan 4, 2021

@pvanheus Can you test again with a recent cwltool version? I feel like we might have fixed this, if not this is an important bug that we should address

@pvanheus
Copy link
Contributor Author

pvanheus commented Jan 4, 2021

This is bug no longer exists when tested with cwltool version 3.0.20200807132242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants