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 --validate is success --make-template becomes failure #1944

Open
manabuishii opened this issue Nov 15, 2023 · 0 comments
Open

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

manabuishii opened this issue Nov 15, 2023 · 0 comments

Comments

@manabuishii
Copy link
Contributor

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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant