Skip to content

Selected input parameter type is not propagated as output parameter type #2039

Open
@adrabent

Description

@adrabent

Expected Behavior

cwltool should treat the input type identical to the output type (at least if it accepts two different types)

Actual Behavior

cwltool crashes, because it always uses the output type Directory instead of Directory[]

Workflow Code

class: CommandLineTool
cwlVersion: v1.2
id: pass
baseCommand: echo
inputs:
  - id: msin
    type: 
      - Directory
      - Directory[]
outputs:
  - id: msout
    type:
      - Directory
      - Directory[]
    outputBinding:
      outputEval: $(inputs.msin)

I call the command like this:

cwltool steps/pass.cwl debug.json

with debug.json:

{
    "msin": [
                {"class": "Directory", "path": "<dir1>"},
                {"class": "Directory", "path": "<dir2>"}
            ]
}

Full Traceback

INFO /usr/local/conda/envs/toil/bin/cwltool 3.1.20240508115724
INFO Resolved 'steps/pass.cwl' to 'file:///home/alex/software/LINC/steps/pass.cwl'
INFO [job pass] /tmp/6scfxd33$ echo

ERROR [job pass] Job error:
("Error collecting output for parameter 'msout': steps/pass.cwl:19:7: Multiple matches for output item that is a single file.", {})
WARNING [job pass] completed permanentFail
{}
WARNING Final process status is permanentFail

Your Environment

  • cwltool version: 3.1.20240508115724

What works

  • Removing one element from debug.json so that the array has only one element
  • Removing Directory as a possible output type for msout

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