common-workflow-language / schema_salad

Semantic Annotations for Linked Avro Data

Home Page:https://www.commonwl.org/v1.2/SchemaSalad.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confusing messaging on format error for CWL input object

pvanheus opened this issue · comments

Backstore: this stack trace:

$ cwltool --debug protein_evidence_mapping.cwl inputs/single_protein.yml 
INFO /home/pvh/miniconda3/envs/planemo/bin/cwltool 3.1.20211107152837
INFO Resolved 'protein_evidence_mapping.cwl' to 'file:///home/pvh/Documents/code/Masters/protein_evidence_mapping/protein_evidence_mapping.cwl'
ERROR I'm sorry, I couldn't load this CWL file.
The error was: 
Traceback (most recent call last):
  File "/home/pvh/miniconda3/envs/planemo/lib/python3.10/site-packages/cwltool/main.py", line 1071, in main
    job_order_object, input_basedir, jobloader = load_job_order(
  File "/home/pvh/miniconda3/envs/planemo/lib/python3.10/site-packages/cwltool/main.py", line 355, in load_job_order
    job_order_object, _ = loader.resolve_ref(
  File "schema_salad/ref_resolver.py", line 537, in resolve_ref
  File "schema_salad/ref_resolver.py", line 870, in resolve_all
TypeError: dict object expected; got None

This was caused by a malformed YML file used as a CWL input object:

contigs_fasta:
  class: File
  format: edam:format_1929
  path: XXXXX
proteins_fasta:
  class: File
  format: edam:format_1929
  path: YYYY
species_table: cynosemi

$namespaces:
edam: http://edamontology.org/
$schemas:
- http://edamontology.org/EDAM_1.18.owl

(notice that incorrect indents in the $namespace object. It was not clear from the errors where the problem was - I first started looking in the CWL workflow before looking at the input object.

Thanks for this report and example, @pvanheus

With #615 , you would have gotten the following error:

ERROR Tool definition failed validation:
single_protein.yml:11:1: $namespaces must be a dictionary