broadinstitute / cromwell

Scientific workflow engine designed for simplicity & scalability. Trivially transition between one off use cases to massive scale production environments
http://cromwell.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
996 stars 360 forks source link

CWL parse issue; not conforming to CWL spec #4338

Closed blawney closed 2 years ago

blawney commented 6 years ago

This potential bug was encountered while writing a CWL task that required a pair of inputs. Namely, Cromwell is requiring a parameter that is both 1) not required per CWL spec and 2) not even used. Working and failing examples given below.

I am on a Linux Mint (19) machine, using cromwell-36.jar (downloaded October 29, 2018) with java10:

$ java -version
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)

For both the working and failing CWL files, I use the following input:

{
  "paired_parameters": {
        "itemA": "one",
        "itemB": "two"
  }
}

Below is the successful CWL file. In particular, note the inputs.type.name which is set to a garbage value.

{
  "cwlVersion": "v1.0",
  "class": "CommandLineTool",
  "inputs": [
    {
      "id": "paired_parameters",
      "type": {
        "type": "record",
        "name": "SOME JUNK VALUE",
        "fields": [
          {
            "name": "itemA",
            "type": "string",
            "inputBinding": {
              "prefix": "-A=",
              "separate": false
            }
          },
          {
            "name": "itemB",
            "type": "string",
            "inputBinding": {
              "prefix": "-B=",
              "separate": false
            }
          }
        ]
      }
    }
  ],
  "outputs": {
    "example_out": {
      "type": "stdout"
    }
  },
  "stdout": "output.txt",
  "baseCommand": "echo"
}

This was run with: java -jar cromwell-36.jar run works.json --inputs inputs.json.

There are two issues:

As mentioned, ignoring the name parameter is probably acceptable, BUT if I remove that parameter, the execution fails. The failing example is the same, but with "name": "SOME JUNK VALUE", removed:

$ diff works.json fails.json 
9d8
<         "name": "SOME JUNK VALUE",

The stack trace reports:

[2018-10-30 21:46:32,22] [error] WorkflowManagerActor Workflow de935a6c-85a6-476f-845f-cf5360bbef03 failed (during MaterializingWorkflowDescriptorState): cromwell.engine.workflow.lifecycle.materialization.MaterializeWorkflowDescriptorActor$$anon$1: Workflow input processing failed:
error when parsing file /tmp/cwl_temp_dir_9897655526044348367/cwl_temp_file_de935a6c-85a6-476f-845f-cf5360bbef03.cwl
DecodingFailure at .inputs[0].type: DecodingFailure at .inputs[0].type: DecodingFailure at .inputs[0].type: String
rebrown1395 commented 5 years ago

@geoffjentry