question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

toil-cwl-runner cannot parse default if parent workflow does not provide input

See original GitHub issue

Error log:

WARNING:toil.leader:9/C/job6PDNtG    WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages', name='toil.cwl.cwltoil', fromVirtualEnv=True).
WARNING:toil.leader:9/C/job6PDNtG    DEBUG:toil.resource:Module dir is /home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages
WARNING:toil.leader:9/C/job6PDNtG    WARNING:toil.resource:Can't globalize module ModuleDescriptor(dirPath='/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages', name='toil.cwl.cwltoil', fromVirtualEnv=True).
WARNING:toil.leader:9/C/job6PDNtG    DEBUG:toil.fileStore:LOG-TO-MASTER: Job 4/O/jobqSOorG/g/tmpQUrbBM-_serialiseJob-stream used 0.00% (1.5 KB [1536B] used, 10.0 GB [10737418240B] requested) at the end of its run.
WARNING:toil.leader:9/C/job6PDNtG    Traceback (most recent call last):
WARNING:toil.leader:9/C/job6PDNtG      File "/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages/toil/worker.py", line 324, in workerScript
WARNING:toil.leader:9/C/job6PDNtG        job._runner(jobGraph=jobGraph, jobStore=jobStore, fileStore=fileStore)
WARNING:toil.leader:9/C/job6PDNtG      File "/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages/toil/job.py", line 1351, in _runner
WARNING:toil.leader:9/C/job6PDNtG        returnValues = self._run(jobGraph, fileStore)
WARNING:toil.leader:9/C/job6PDNtG      File "/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages/toil/job.py", line 1296, in _run
WARNING:toil.leader:9/C/job6PDNtG        return self.run(fileStore)
WARNING:toil.leader:9/C/job6PDNtG      File "/home/johnsoni/virtualenvs/pipeline_1.2.6/lib/python2.7/site-packages/toil/cwl/cwltoil.py", line 917, in run
WARNING:toil.leader:9/C/job6PDNtG        jobobj[key][0]] is None:
WARNING:toil.leader:9/C/job6PDNtG    KeyError: u'bam_compression_level'
WARNING:toil.leader:9/C/job6PDNtG    ERROR:toil.worker:Exiting the worker because of a failed job on host jx21
WARNING:toil.leader:9/C/job6PDNtG    WARNING:toil.jobGraph:Due to failure we are reducing the remaining retry count of job 'CWLWorkflow' 9/C/job6PDNtG with ID 9/C/job6PDNtG to 0
DEBUG:toil.leader:Added job: 'CWLWorkflow' 9/C/job6PDNtG to active jobs
DEBUG:toil.leader:Built the jobs list, currently have 1 jobs to update and 0 jobs issued

I believe that these lines from cwltoil.py:

                            if "default" in inp:
                                if key in jobobj:
                                    if isinstance(jobobj[key][1], Promise):
                                        d = copy.copy(inp["default"])
                                        jobobj[key] = DefaultWithSource(
                                            d, jobobj[key])
                                    else:
                                        if jobobj[key][1][
                                                jobobj[key][0]] is None:
                                            d = copy.copy(inp["default"])
                                            jobobj[key] = (
                                                "default", {"default": d})
                                else:
                                    d = copy.copy(inp["default"])
                                    jobobj[key] = ("default", {"default": d})

Should be change to:

                                        if hasattr(jobobj[key][1], jobobj[key][0]) and \
                                            and jobobj[key][1][jobobj[key][0]] is None:
                                                ...

but it’s a bit hard to understand the difference between jobobj[key][0] and jobobj[key][1]

┆Issue is synchronized with this Jira Task ┆Issue Number: TOIL-425

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ionox0commented, Sep 24, 2019

I edited the title of this issue as I’ve found a minimally-reproducible example:

tool.cwl:

cwlVersion: v1.0

class: CommandLineTool

baseCommand: echo

inputs:

  input_one:
    type: int?
    inputBinding:
      position: 2

outputs: []

subworkflow.cwl:

cwlVersion: v1.0

class: Workflow

inputs:

  one: int?

outputs: []

steps:

  step_one:
    run: ./tool.cwl
    in:
      input_one:
        source: one
        default: 2
    out: []

parent_workflow.cwl:

cwlVersion: v1.0

class: Workflow

requirements:
  SubworkflowFeatureRequirement: {}

inputs:

  one: int?

outputs: []

steps:

  step_one:
    run: ./child.cwl
    in: []
#      one:
#        source: one
#        default: 1
    out: []

The difference between this workflow passing and failing is based on the presence of the input one in the parent workflow, and without it the following error occurs:

WARNING:toil.leader:c/r/jobqzOvP3    Traceback (most recent call last):
WARNING:toil.leader:c/r/jobqzOvP3      File "/Users/johnsoni/.virtualenvs/toil/lib/python2.7/site-packages/toil/worker.py", line 324, in workerScript
WARNING:toil.leader:c/r/jobqzOvP3        job._runner(jobGraph=jobGraph, jobStore=jobStore, fileStore=fileStore)
WARNING:toil.leader:c/r/jobqzOvP3      File "/Users/johnsoni/.virtualenvs/toil/lib/python2.7/site-packages/toil/job.py", line 1351, in _runner
WARNING:toil.leader:c/r/jobqzOvP3        returnValues = self._run(jobGraph, fileStore)
WARNING:toil.leader:c/r/jobqzOvP3      File "/Users/johnsoni/.virtualenvs/toil/lib/python2.7/site-packages/toil/job.py", line 1296, in _run
WARNING:toil.leader:c/r/jobqzOvP3        return self.run(fileStore)
WARNING:toil.leader:c/r/jobqzOvP3      File "/Users/johnsoni/.virtualenvs/toil/lib/python2.7/site-packages/toil/cwl/cwltoil.py", line 917, in run
WARNING:toil.leader:c/r/jobqzOvP3        jobobj[key][0]] is None:
WARNING:toil.leader:c/r/jobqzOvP3    KeyError: u'one'
WARNING:toil.leader:c/r/jobqzOvP3    ERROR:toil.worker:Exiting the worker because of a failed job on host lski2427
WARNING:toil.leader:c/r/jobqzOvP3    WARNING:toil.jobGraph:Due to failure we are reducing the remaining retry count of job 'CWLWorkflow' c/r/jobqzOvP3 with ID c/r/jobqzOvP3 to 0

It is not present with cwltool, which runs successfully

1reaction
mr-ccommented, May 12, 2021

assigned to myself

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with running the workflow with toil-cwl-runner but not ...
Hi we tried to run the workflow at the repository: If we run the ... toil-cwl-runner cannot parse default if parent workflow does...
Read more >
Toil Documentation
Toil is an open-source pure-Python workflow engine that lets people write better pipelines. Check out our website for a comprehensive list ...
Read more >
Incorrect parsing of wdl - Terra Support
I noticed strange behavior in the method configuration. It suddenly got populated with a large number of default parameters (see screenshot):.
Read more >
User Settings | Alteryx Help
If so, the user settings and workflow properties only have an option to decrease them. ... This is the default view for the...
Read more >
How to fix parse error when missing data from the input source ...
I have a workflow that is getting a parse error, because the fields are ... I'm wondering if adding a text input is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found