Skip to content

cwltool --validate is success --make-template becomes failure #1944

@manabuishii

Description

@manabuishii

Expected Behavior

Output template something like this.

(cwlenv) ➜  create_issue cwltool --validate success.cwl     
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'success.cwl' to 'file:///home/manabu/work/CWL/create_issue/success.cwl'
success.cwl is valid CWL.
(cwlenv) ➜  create_issue cwltool --make-template success.cwl
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'success.cwl' to 'file:///home/manabu/work/CWL/create_issue/success.cwl'
params:  # array of "file:///home/manabu/work/CWL/create_issue/success.cwl#params/ParamPair" record type.
  - param2: a_string  # type 'string'
    param1: a_string  # type 'string'

Actual Behavior

No template output.

(cwlenv) ➜  create_issue cwltool --validate problem.cwl 
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'problem.cwl' to 'file:///home/manabu/work/CWL/create_issue/problem.cwl'
problem.cwl is valid CWL.
(cwlenv) ➜  create_issue cwltool --validate problem.cwl 
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'problem.cwl' to 'file:///home/manabu/work/CWL/create_issue/problem.cwl'
problem.cwl is valid CWL.
(cwlenv) ➜  create_issue cwltool --make-template problem.cwl
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'problem.cwl' to 'file:///home/manabu/work/CWL/create_issue/problem.cwl'
ERROR I'm sorry, I couldn't load this CWL file, try again with --debug for more information.
The error was: 0

Workflow Code

success.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.2
class: CommandLineTool

inputs:
  params:
    type:
      type: array
      items:
        - type: record
          name: ParamPair
          fields:
            - name: param1
              type: string
            - name: param2
              type: string
outputs: []

baseCommand: []

problem.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.2
class: CommandLineTool

inputs:
  params:
    type:
      type: array
      items:
        type: record
        name: ParamPair
        fields:
          - name: param1
            type: string
          - name: param2
            type: string
outputs: []

baseCommand: []

Full Traceback

(cwlenv) ➜  create_issue cwltool  --debug --make-template problem.cwl
INFO /home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
INFO Resolved 'problem.cwl' to 'file:///home/manabu/work/CWL/create_issue/problem.cwl'
ERROR I'm sorry, I couldn't load this CWL file.
The error was: 
Traceback (most recent call last):
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/cwltool/main.py", line 1135, in main
    make_template(tool, stdout)
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/cwltool/main.py", line 754, in make_template
    generate_input_template(tool),
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/cwltool/main.py", line 342, in generate_input_template
    value, comment = generate_example_input(inp["type"], inp.get("default", None))
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/cwltool/main.py", line 204, in generate_example_input
    example, comment = generate_example_input(inptype[0], default)
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/cwltool/main.py", line 222, in generate_example_input
    first_item = cast(MutableSequence[CWLObjectType], inptype["items"])[0]
  File "/home/manabu/work/CWL/create_issue/cwlenv/lib/python3.10/site-packages/ruamel/yaml/comments.py", line 851, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 0
(cwlenv) ➜  create_issue 

Your Environment

  • cwltool version:
    Check using cwltool --version
(cwlenv) ➜  create_issue cwltool --version
/home/manabu/work/CWL/create_issue/cwlenv/bin/cwltool 3.1.20231114134824
(cwlenv) ➜  create_issue 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions