Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toil-wdl-runner does not handle string to file coercion properly for optional file types #4992

Closed
stxue1 opened this issue Jun 27, 2024 · 0 comments · Fixed by #5028
Closed

Comments

@stxue1
Copy link
Contributor

stxue1 commented Jun 27, 2024

version 1.1
workflow testWorkflow {
  input {
  }
  call testTask
  output {
    Array[File?] array_in_output = testTask.array_in_output
    Int len_in_output = testTask.len_in_output
    Array[File?] array_in_body_out = testTask.array_in_body_out
    Int len_in_body_out = testTask.len_in_body_out
    Array[File?] array_in_input_out = testTask.array_in_input_out
    Int len_in_input_out = testTask.len_in_input_out
  }
}

task testTask {
  input {
    Array[File?] array_in_input = ["example1.txt", "example2.txt"]
    Int len_in_input = length(select_all(array_in_input))
  }
  command <<<>>>
  Array[File?] array_in_body = ["example1.txt", "example2.txt"]
  Int len_in_body = length(select_all(array_in_body))
  output {
    Array[File?] array_in_output = ["example1.txt", "example2.txt"]
    Int len_in_output = length(select_all(array_in_output))
    Array[File?] array_in_body_out = array_in_body
    Int len_in_body_out = len_in_body
    Array[File?] array_in_input_out = array_in_input
    Int len_in_input_out = len_in_input
  }
}
Workflow Progress 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 (2 failures) [00:06<00:00, 0.31 jobs/s]
Traceback (most recent call last):
  File "/home/heaucques/Documents/toil/venv3.12/bin/toil-wdl-runner", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 143, in decorated
    return decoratee(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/heaucques/Documents/toil/src/toil/wdl/wdltoil.py", line 3401, in main
    output_bindings = toil.start(root_job)
                      ^^^^^^^^^^^^^^^^^^^^
  File "/home/heaucques/Documents/toil/src/toil/common.py", line 940, in start
    return self._runMainLoop(rootJobDescription)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/heaucques/Documents/toil/src/toil/common.py", line 1427, in _runMainLoop
    jobCache=self._jobCache).run()
                             ^^^^^
  File "/home/heaucques/Documents/toil/src/toil/leader.py", line 293, in run
    raise FailedJobsException(self.jobStore, failed_jobs, exit_code=self.recommended_fail_exit_code)
toil.exceptions.FailedJobsException: The job store '/tmp/tmphms0zesx/tree' contains 1 failed jobs: 'WDLTaskWrapperJob' testWorkflow.testTask.inputs kind-WDLRootJob/instance-zx1nkxjy v12
Log from job "'WDLTaskWrapperJob' testWorkflow.testTask.inputs kind-WDLRootJob/instance-zx1nkxjy v12" follows:
=========>
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.worker] ---TOIL WORKER OUTPUT LOG---
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil] Running Toil version 7.1.0a1-ccf57e6071e32675daabdcbacb91988e871745a9 on host pop-os.
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.worker] Working on job 'WDLTaskWrapperJob' testWorkflow.testTask.inputs kind-WDLRootJob/instance-zx1nkxjy v10
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.worker] Loaded body Job('WDLTaskWrapperJob' testWorkflow.testTask.inputs kind-WDLRootJob/instance-zx1nkxjy v10) from description 'WDLTaskWrapperJob' testWorkflow.testTask.inputs kind-WDLRootJob/instance-zx1nkxjy v10
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.wdl.wdltoil] Evaluating inputs and runtime for task testTask (['testTask']) called as testWorkflow.testTask
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.wdl.wdltoil] Defaulting array_in_input to ["example1.txt", "example2.txt"]
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.wdl.wdltoil] Defaulting len_in_input to length(select_all(array_in_input))
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.wdl.wdltoil] Defaulting array_in_body to ["example1.txt", "example2.txt"]
	[2024-06-26T18:59:44-0700] [MainThread] [I] [toil.wdl.wdltoil] Defaulting len_in_body to length(select_all(array_in_body))
	[2024-06-26T18:59:44-0700] [MainThread] [C] [toil.wdl.wdltoil] Could not evaluate task code because:
	
	🚨🚨🚨
	[Errno 2] No such file or directory: '/tmp/toilwf-a8a916d9dc5a5a028892a55718782ccc/9777/job/example1.txt'
	🚨🚨🚨
	
	[2024-06-26T18:59:44-0700] [MainThread] [E] [toil.worker] Exiting the worker because of a failed job on host pop-os

The above workflow does not work as Toil attempts to check that example1.txt exists despite the type being declared as optional. This should mean the array becomes [null, null].

This is related to chanzuckerberg/miniwdl#696. MiniWDL handles this case only on task outputs (workflows do not work) by running a check at file exports.

┆Issue is synchronized with this Jira Story
┆Issue Number: TOIL-1605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant