common-workflow-language / common-workflow-language/cwltool

double validation fails

Open
#839 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

The following code fails:

```python
workflow = cwltool.factory.Factory().make(cwl_file).t
g = cwltool.cwlrdf.gather(workflow, workflow.doc_loader.ctx)
workflow = cwltool.factory.Factory().make(cwl_file).t # this throws
```

error:

```
ERROR:cwltool:I'm sorry, I couldn't load this CWL file.
The error was:
Traceback (most recent call last):
File "/Users/giacomo/.virtualenvs/cwltool-dev/lib/python3.6/site-packages/cwltool/main.py", line 488, in main
do_validate=loadingContext.do_validate)
File "/Users/giacomo/.virtualenvs/cwltool-dev/lib/python3.6/site-packages/cwltool/load_tool.py", line 280, in validate_document
workflowobj, fileuri, checklinks=do_validate)
File "/Users/giacomo/.virtualenvs/cwltool-dev/lib/python3.6/site-packages/schema_salad/ref_resolver.py", line 871, in resolve_all
val, base_url+subscope, file_base=file_base, checklinks=False)
File "/Users/giacomo/.virtualenvs/cwltool-dev/lib/python3.6/site-packages/schema_salad/ref_resolver.py", line 813, in resolve_all
raise Exception("Expected CommentedMap or CommentedSeq, got %s: `%s`" % (type(document), document))
Exception: Expected CommentedMap or CommentedSeq, got : `{'cwl': 'https://w3id.org/cwl/cwl#', 'sld': 'https://w3id.org/cwl/salad#', 'PrimitiveType': 'https://w3id.org/cwl/salad#PrimitiveType', 'null': 'https://w3id.org/cwl/salad#null', 'boolean': 'http://www.w3.org/2001/XMLSchema#boolean', 'int': 'http://www.w3.org/2001/XMLSchema#int', 'long': 'http://www.w3.org/2001/XMLSchema#long', 'float': 'http://www.w3.org/2001/XMLSchema#float', 'double': 'http://www.w3.org/2001/XMLSchema#double', 'string': 'http://www.w3.org/2001/XMLSchema#string', 'Any': 'https://w3id.org/cwl/salad#Any', 'RecordField': 'https://w3id.org/cwl/salad#RecordField', 'name': '@id', 'doc': 'rdfs:comment', 'type': {'@id': 'https://w3id.org/cwl/salad#type', '@type': '@vocab', 'typeDSL': True, 'refScope': 2}, 'RecordSchema': 'https://w3id.org/cwl/salad#RecordSchema', 'fields': {'@id': 'https://w3id.org/cwl/salad#fields', 'mapSubject': 'name', 'mapPredicate': 'type'}, 'Record_symbol': 'https://w3id.org/cwl/salad#RecordSchema/type/Record_symbol', 'record': 'https://w3id.org/cwl/salad#record', 'EnumSchema': 'https://w3id.org/cwl/salad#EnumSchema', 'symbols': {'@id': 'https://w3id.org/cwl/salad#symbols', '@type': '@id', 'identity': True}, 'Enum_symbol': 'https://w3id.org/cwl/salad#EnumSchema/type/Enum_symbol', 'enum': 'https://w3id.org/cwl/salad#enum', 'ArraySchema': 'https://w3id.org/cwl/salad#ArraySchema', 'items': {'@id': 'https://w3id.org/cwl/salad#items', '@type': '@vocab', 'refScope': 2}, 'Array_symbol': 'https://w3id.org/cwl/salad#ArraySchema/type/Array_symbol', 'array': 'https://w3id.org/cwl/salad#array', 'CWLVersion': 'https://w3id.org/cwl/cwl#CWLVersion', 'draft-2': 'https://w3id.org/cwl/cwl#draft-2', 'draft-3.dev1': 'https://w3id.org/cwl/cwl#draft-3.dev1', 'draft-3.dev2': 'https://w3id.org/cwl/cwl#draft-3.dev2', 'draft-3.dev3': 'https://w3id.org/cwl/cwl#draft-3.dev3', 'draft-3.dev4': 'https://w3id.org/cwl/cwl#draft-3.dev4', 'draft-3.dev5': 'https://w3id.org/cwl/cwl#draft-3.dev5', 'draft-3': 'https://w3id.org/cwl/cwl#draft-3', 'draft-4.dev1': 'https://w3id.org/cwl/cwl#draft-4.dev1', 'draft-4.dev2': 'https://w3id.org/cwl/cwl#draft-4.dev2', 'draft-4.dev3': 'https://w3id.org/cwl/cwl#draft-4.dev3', 'v1.0.dev4': 'https://w3id.org/cwl/cwl#v1.0.dev4', 'v1.0': 'https://w3id.org/cwl/cwl#v1.0', 'CWLType': 'https://w3id.org/cwl/cwl#CWLType', 'File': 'https://w3id.org/cwl/cwl#File', 'Directory': 'https://w3id.org/cwl/cwl#Directory', 'class': {'@id': '@type', '@type': '@vocab'}, 'File_class': 'https://w3id.org/cwl/cwl#File/class/File_class', 'location': {'@id': '@id', '@type': '@id'}, 'path': {'@id': 'https://w3id.org/cwl/cwl#path', '@type': '@id'}, 'basename': 'cwl:basename', 'dirname': 'https://w3id.org/cwl/cwl#File/dirname', 'nameroot': 'https://w3id.org/cwl/cwl#File/nameroot', 'nameext': 'https://w3id.org/cwl/cwl#File/nameext', 'checksum': 'https://w3id.org/cwl/cwl#File/checksum', 'size': 'https://w3id.org/cwl/cwl#File/size', 'secondaryFiles': 'cwl:secondaryFiles', 'format': {'@id': 'https://w3id.org/cwl/cwl#format', '@type': '@id', 'identity': True}, 'contents': 'https://w3id.org/cwl/cwl#File/contents', 'Directory_class': 'https://w3id.org/cwl/cwl#Directory/class/Directory_class', 'listing': {'@id': 'https://w3id.org/cwl/cwl#listing'}, 'SchemaBase': 'https://w3id.org/cwl/cwl#SchemaBase', 'label': 'rdfs:label', 'Parameter': 'https://w3id.org/cwl/cwl#Parameter', 'streamable': 'https://w3id.org/cwl/cwl#Parameter/streamable', 'Expression': 'https://w3id.org/cwl/cwl#Expression', 'ExpressionPlaceholder': 'https://w3id.org/cwl/cwl#ExpressionPlaceholder', 'InputBinding': 'https://w3id.org/cwl/cwl#InputBinding', 'loadContents': 'cwl:loadContents', 'OutputBinding': 'https://w3id.org/cwl/cwl#OutputBinding', 'InputSchema': 'https://w3id.org/cwl/cwl#InputSchema', 'OutputSchema': 'https://w3id.org/cwl/cwl#OutputSchema', 'InputRecordField': 'https://w3id.org/cwl/cwl#InputRecordField', 'inputBinding': 'cwl:inputBinding', 'InputRecordSchema': 'https://w3id.org/cwl/cwl#InputRecordSchema', 'InputEnumSchema': 'https://w3id.org/cwl/cwl#InputEnumSchema', 'InputArraySchema': 'https://w3id.org/cwl/cwl#InputArraySchema', 'OutputRecordField': 'https://w3id.org/cwl/cwl#OutputRecordField', 'outputBinding': 'cwl:outputBinding', 'OutputRecordSchema': 'https://w3id.org/cwl/cwl#OutputRecordSchema', 'OutputEnumSchema': 'https://w3id.org/cwl/cwl#OutputEnumSchema', 'OutputArraySchema': 'https://w3id.org/cwl/cwl#OutputArraySchema', 'InputParameter': 'https://w3id.org/cwl/cwl#InputParameter', 'id': '@id', 'default': {'@id': 'https://w3id.org/cwl/cwl#default', 'noLinkCheck': True}, 'OutputParameter': 'https://w3id.org/cwl/cwl#OutputParameter', 'ProcessRequirement': 'https://w3id.org/cwl/cwl#ProcessRequirement', 'Process': 'https://w3id.org/cwl/cwl#Process', 'inputs': {'@id': 'https://w3id.org/cwl/cwl#inputs', 'mapSubject': 'id', 'mapPredicate': 'type'}, 'outputs': {'@id': 'https://w3id.org/cwl/cwl#outputs', 'mapSubject': 'id', 'mapPredicate': 'type'}, 'requirements': {'@id': 'https://w3id.org/cwl/cwl#requirements', 'mapSubject': 'class'}, 'hints': {'@id': 'https://w3id.org/cwl/cwl#hints', 'noLinkCheck': True, 'mapSubject': 'class'}, 'cwlVersion': {'@id': 'https://w3id.org/cwl/cwl#cwlVersion', '@type': '@vocab'}, 'InlineJavascriptRequirement': 'https://w3id.org/cwl/cwl#InlineJavascriptRequirement', 'expressionLib': 'https://w3id.org/cwl/cwl#InlineJavascriptRequirement/expressionLib', 'SchemaDefRequirement': 'https://w3id.org/cwl/cwl#SchemaDefRequirement', 'types': 'https://w3id.org/cwl/cwl#SchemaDefRequirement/types', 'EnvironmentDef': 'https://w3id.org/cwl/cwl#EnvironmentDef', 'envName': 'https://w3id.org/cwl/cwl#EnvironmentDef/envName', 'envValue': 'https://w3id.org/cwl/cwl#EnvironmentDef/envValue', 'CommandLineBinding': 'https://w3id.org/cwl/cwl#CommandLineBinding', 'position': 'https://w3id.org/cwl/cwl#CommandLineBinding/position', 'prefix': 'https://w3id.org/cwl/cwl#CommandLineBinding/prefix', 'separate': 'https://w3id.org/cwl/cwl#CommandLineBinding/separate', 'itemSeparator': 'https://w3id.org/cwl/cwl#CommandLineBinding/itemSeparator', 'valueFrom': 'cwl:valueFrom', 'shellQuote': 'https://w3id.org/cwl/cwl#CommandLineBinding/shellQuote', 'CommandOutputBinding': 'https://w3id.org/cwl/cwl#CommandOutputBinding', 'glob': 'https://w3id.org/cwl/cwl#CommandOutputBinding/glob', 'outputEval': 'https://w3id.org/cwl/cwl#CommandOutputBinding/outputEval', 'CommandInputRecordField': 'https://w3id.org/cwl/cwl#CommandInputRecordField', 'CommandInputRecordSchema': 'https://w3id.org/cwl/cwl#CommandInputRecordSchema', 'CommandInputEnumSchema': 'https://w3id.org/cwl/cwl#CommandInputEnumSchema', 'CommandInputArraySchema': 'https://w3id.org/cwl/cwl#CommandInputArraySchema', 'CommandOutputRecordField': 'https://w3id.org/cwl/cwl#CommandOutputRecordField', 'CommandOutputRecordSchema': 'https://w3id.org/cwl/cwl#CommandOutputRecordSchema', 'CommandOutputEnumSchema': 'https://w3id.org/cwl/cwl#CommandOutputEnumSchema', 'CommandOutputArraySchema': 'https://w3id.org/cwl/cwl#CommandOutputArraySchema', 'CommandInputParameter': 'https://w3id.org/cwl/cwl#CommandInputParameter', 'CommandOutputParameter': 'https://w3id.org/cwl/cwl#CommandOutputParameter', 'stdout': 'https://w3id.org/cwl/cwl#stdout', 'stderr': 'https://w3id.org/cwl/cwl#stderr', 'CommandLineTool': 'https://w3id.org/cwl/cwl#CommandLineTool', 'baseCommand': {'@id': 'https://w3id.org/cwl/cwl#baseCommand', '@container': '@list'}, 'arguments': {'@id': 'https://w3id.org/cwl/cwl#arguments', '@container': '@list'}, 'stdin': 'https://w3id.org/cwl/cwl#CommandLineTool/stdin', 'successCodes': 'https://w3id.org/cwl/cwl#CommandLineTool/successCodes', 'temporaryFailCodes': 'https://w3id.org/cwl/cwl#CommandLineTool/temporaryFailCodes', 'permanentFailCodes': 'https://w3id.org/cwl/cwl#CommandLineTool/permanentFailCodes', 'DockerRequirement': 'https://w3id.org/cwl/cwl#DockerRequirement', 'dockerPull': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerPull', 'dockerLoad': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerLoad', 'dockerFile': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerFile', 'dockerImport': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerImport', 'dockerImageId': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerImageId', 'dockerOutputDirectory': 'https://w3id.org/cwl/cwl#DockerRequirement/dockerOutputDirectory', 'SoftwareRequirement': 'https://w3id.org/cwl/cwl#SoftwareRequirement', 'packages': {'mapSubject': 'package', 'mapPredicate': 'specs', '@id': 'https://w3id.org/cwl/cwl#SoftwareRequirement/packages'}, 'SoftwarePackage': 'https://w3id.org/cwl/cwl#SoftwarePackage', 'package': 'https://w3id.org/cwl/cwl#SoftwarePackage/package', 'version': 'https://w3id.org/cwl/cwl#SoftwarePackage/version', 'specs': 'https://w3id.org/cwl/cwl#SoftwarePackage/specs', 'Dirent': 'https://w3id.org/cwl/cwl#Dirent', 'entryname': {'@id': 'https://w3id.org/cwl/cwl#entryname'}, 'entry': {'@id': 'https://w3id.org/cwl/cwl#entry'}, 'writable': 'https://w3id.org/cwl/cwl#Dirent/writable', 'InitialWorkDirRequirement': 'https://w3id.org/cwl/cwl#InitialWorkDirRequirement', 'EnvVarRequirement': 'https://w3id.org/cwl/cwl#EnvVarRequirement', 'envDef': {'mapSubject': 'envName', 'mapPredicate': 'envValue', '@id': 'https://w3id.org/cwl/cwl#EnvVarRequirement/envDef'}, 'ShellCommandRequirement': 'https://w3id.org/cwl/cwl#ShellCommandRequirement', 'ResourceRequirement': 'https://w3id.org/cwl/cwl#ResourceRequirement', 'coresMin': 'https://w3id.org/cwl/cwl#ResourceRequirement/coresMin', 'coresMax': 'https://w3id.org/cwl/cwl#ResourceRequirement/coresMax', 'ramMin': 'https://w3id.org/cwl/cwl#ResourceRequirement/ramMin', 'ramMax': 'https://w3id.org/cwl/cwl#ResourceRequirement/ramMax', 'tmpdirMin': 'https://w3id.org/cwl/cwl#ResourceRequirement/tmpdirMin', 'tmpdirMax': 'https://w3id.org/cwl/cwl#ResourceRequirement/tmpdirMax', 'outdirMin': 'https://w3id.org/cwl/cwl#ResourceRequirement/outdirMin', 'outdirMax': 'https://w3id.org/cwl/cwl#ResourceRequirement/outdirMax', 'ExpressionToolOutputParameter': 'https://w3id.org/cwl/cwl#ExpressionToolOutputParameter', 'ExpressionTool': 'https://w3id.org/cwl/cwl#ExpressionTool', 'expression': 'https://w3id.org/cwl/cwl#ExpressionTool/expression', 'LinkMergeMethod': 'https://w3id.org/cwl/cwl#LinkMergeMethod', 'merge_nested': 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_nested', 'merge_flattened': 'https://w3id.org/cwl/cwl#LinkMergeMethod/merge_flattened', 'WorkflowOutputParameter': 'https://w3id.org/cwl/cwl#WorkflowOutputParameter', 'outputSource': {'@id': 'https://w3id.org/cwl/cwl#outputSource', '@type': '@id', 'refScope': 0}, 'linkMerge': 'cwl:linkMerge', 'Sink': 'https://w3id.org/cwl/cwl#Sink', 'source': {'@id': 'https://w3id.org/cwl/cwl#source', '@type': '@id', 'refScope': 2}, 'WorkflowStepInput': 'https://w3id.org/cwl/cwl#WorkflowStepInput', 'WorkflowStepOutput': 'https://w3id.org/cwl/cwl#WorkflowStepOutput', 'ScatterMethod': 'https://w3id.org/cwl/cwl#ScatterMethod', 'dotproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/dotproduct', 'nested_crossproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/nested_crossproduct', 'flat_crossproduct': 'https://w3id.org/cwl/cwl#ScatterMethod/flat_crossproduct', 'WorkflowStep': 'https://w3id.org/cwl/cwl#WorkflowStep', 'in': {'@id': 'https://w3id.org/cwl/cwl#in', 'mapSubject': 'id', 'mapPredicate': 'source'}, 'out': {'@id': 'https://w3id.org/cwl/cwl#out', '@type': '@id', 'identity': True}, 'run': {'@id': 'https://w3id.org/cwl/cwl#run', '@type': '@id', 'id': '0f5f0188-aef1-4282-a032-c60ca8ebe1e5'}, 'scatter': {'@id': 'https://w3id.org/cwl/cwl#scatter', '@type': '@id', '@container': '@list', 'refScope': 0}, 'scatterMethod': {'@id': 'https://w3id.org/cwl/cwl#scatterMethod', '@type': '@vocab'}, 'Workflow': 'https://w3id.org/cwl/cwl#Workflow', 'steps': {'mapSubject': 'id', '@id': 'https://w3id.org/cwl/cwl#Workflow/steps'}, 'SubworkflowFeatureRequirement': 'https://w3id.org/cwl/cwl#SubworkflowFeatureRequirement', 'ScatterFeatureRequirement': 'https://w3id.org/cwl/cwl#ScatterFeatureRequirement', 'MultipleInputFeatureRequirement': 'https://w3id.org/cwl/cwl#MultipleInputFeatureRequirement', 'StepInputExpressionRequirement': 'https://w3id.org/cwl/cwl#StepInputExpressionRequirement', '@id': '@id'}`
Traceback (most recent call last):
File "entry.py", line 172, in
main()
File "entry.py", line 165, in main
WORKFLOW_FILENAME, INPUT_FILENAME,
File "/Users/giacomo/workspace/qsi/cwltool/local-tests/cwl_wrapper.py", line 151, in exec_cwl
raise WorkflowException(f'Worfklow failed ({ret_val})')
cwltool.errors.WorkflowException: Worfklow failed (1)
```

if I remove the `cwltool.cwlrdf.gather` line, then the error is not thrown, so it must be something that is saved globally, but I can't go further than that in my assumptions.

using version `1.0.20180711112827`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.