Skip to content

Confusing error message when specifying a file improperly #264

Closed
@psaffrey-illumina

Description

@psaffrey-illumina

Given this CWL:

class: CommandLineTool
cwlVersion: v1.0

inputs:
  pattern:
    type: string
    inputBinding: {position: 0}
  infile:
    type: File
    inputBinding: {position: 1}

outputs:
  outfile:
    type: stdout

baseCommand: grep

and this input:

infile: testfile.txt
pattern: Requirement

run with this cwltool:

$ cwltool --version
/usr/local/bin/cwltool 1.0.20161216212910

I get this:

Got workflow error
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/cwltool/main.py", line 225, in single_job_executor
    for r in jobiter:
  File "/Library/Python/2.7/site-packages/cwltool/draft2tool.py", line 243, in job
    builder = self._init_job(joborder, **kwargs)
  File "/Library/Python/2.7/site-packages/cwltool/process.py", line 445, in _init_job
    validate.validate_ex(self.names.get_name("input_record_schema", ""), builder.job)
  File "/Library/Python/2.7/site-packages/schema_salad/validate.py", line 267, in validate_ex
    f.name, indent(str(v)))))
  File "/Library/Python/2.7/site-packages/schema_salad/sourceline.py", line 152, in makeError
    lead = "%s:%i:%i:" % (self.item.lc.filename,
AttributeError: 'LineCol' object has no attribute 'filename'

the problem is that the file entry should not be specified as a string, it should be specified with the proper class, like this:

infile: 
  class: File
  path: test_file_one.txt
pattern: Requirement

but the error message does not provide very useful guidance on fixing this.

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