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.

Launching workflows using WES, FileNotFoundError.

See original GitHub issue

I’m currently attempting to setup a local WES server and launch workflows with toil by using the docker-compose section of this documentation page: https://toil.readthedocs.io/en/latest/running/server/wes.html. This appears to function correctly at first, as the containers are running and I can execute basic WES requests against the server (Such as getting the server info and listing the run status of a workflow).

The issue appears when launching a workflow. Launching workflows returns a run ID (as expected), but the workflow hangs in the QUEUED state forever. Taking a look at the server logs, it seems the celery-worker does not have the proper workflow directory files:

celery-worker  |   warnings.warn(SecurityWarning(ROOT_DISCOURAGED.format(
celery-worker  | [2022-01-31 17:45:24,355: ERROR/ForkPoolWorker-2] Task run_wes[8c9f1f3368d744ffb54a6f73eeb7cefd] raised unexpected: FileNotFoundError(2, 'No such file or directory')
celery-worker  | Traceback (most recent call last):
celery-worker  |   File "/app/src/toil/src/toil/server/wes/tasks.py", line 283, in run_wes
celery-worker  |     runner.run()
celery-worker  |   File "/app/src/toil/src/toil/server/wes/tasks.py", line 192, in run
celery-worker  |     self.set_state("INITIALIZING")
celery-worker  |   File "/app/src/toil/src/toil/server/wes/tasks.py", line 64, in set_state
celery-worker  |     safe_write_file(os.path.join(self.work_dir, "state"), state)
celery-worker  |   File "/app/src/toil/src/toil/lib/retry.py", line 256, in call
celery-worker  |     return func(*args, **kwargs)
celery-worker  |   File "/app/src/toil/src/toil/server/utils.py", line 103, in safe_write_file
celery-worker  |     file_obj = open(file, "r+")
celery-worker  | FileNotFoundError: [Errno 2] No such file or directory: '/app/workflows/8c9f1f3368d744ffb54a6f73eeb7cefd/state'
celery-worker  | 
celery-worker  | During handling of the above exception, another exception occurred:
celery-worker  | 
celery-worker  | Traceback (most recent call last):
celery-worker  |   File "/usr/local/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
celery-worker  |     R = retval = fun(*args, **kwargs)
celery-worker  |   File "/usr/local/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
celery-worker  |     return self.run(*args, **kwargs)
celery-worker  |   File "/app/src/toil/src/toil/server/wes/tasks.py", line 294, in run_wes
celery-worker  |     runner.set_state("EXECUTOR_ERROR")
celery-worker  |   File "/app/src/toil/src/toil/server/wes/tasks.py", line 64, in set_state
celery-worker  |     safe_write_file(os.path.join(self.work_dir, "state"), state)
celery-worker  |   File "/app/src/toil/src/toil/lib/retry.py", line 256, in call
celery-worker  |     return func(*args, **kwargs)
celery-worker  |   File "/app/src/toil/src/toil/server/utils.py", line 103, in safe_write_file
celery-worker  |     file_obj = open(file, "r+")

Taking a look inside the containers, I can see the following:

  1. The wes-server container has the appropriate workflow files at /app/workflows/8c9f1f3368d744ffb54a6f73eeb7cefd/state
  2. The celery-worker container does not have the /app/workflows directory (and thus, none of the child files)

To reproduce:

  1. Go to https://toil.readthedocs.io/en/latest/running/server/wes.html
  2. Create the Dockerfile and docker-compose.yml files as specified in https://toil.readthedocs.io/en/latest/running/server/wes.html#running-the-server-with-docker-compose
  3. Run docker compose up (Not using --detach to easily see logs)
  4. Create example.cwl using the example provided in https://toil.readthedocs.io/en/latest/running/server/wes.html#running-the-server-with-docker-compose
  5. Execute the cURL command:
curl --location --request POST 'http://localhost:8080/ga4gh/wes/v1/runs' \
    --form 'workflow_url="example.cwl"' \
    --form 'workflow_type="cwl"' \
    --form 'workflow_type_version="v1.0"' \
    --form 'workflow_params="{\"message\": \"Hello world!\"}"' \
    --form 'workflow_attachment=@"./toil_test_files/example.cwl"'
  1. After a few moments, the celery-worker will receive the request and then error out due to the missing file.

I’m wondering if the WES documentation page is slightly out-of-date, and if the docker-compose.yml or Dockerfile examples should be reconfigured? Not sure, just brainstorming. Thanks!

┆Issue is synchronized with this Jira Story ┆friendlyId: TOIL-1138

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Richard-Hansencommented, Feb 3, 2022

Thanks @w-gao , I was able to successfully run the docker compose file. I did run into some other issues afterwards, so added some comments to the linked PR: https://github.com/DataBiosphere/toil/pull/4027#pullrequestreview-872057152

0reactions
Richard-Hansencommented, Feb 7, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Launching workflows using WES and the Dockstore CLI
To launch a workflow on a WES server, the command can be as simple as: ... You can specify the latest X entries...
Read more >
Build fails with K4A_VALIDATE_CLANG_FORMAT ... - GitHub
I'm running into the same problem as above from a clean build folder. Is it working fine for you even when not using...
Read more >
FileNotFoundError when installing 16s databases
Hi Rebecca, The workflows use the PICRUSt v1 script to install its databases. The workflows have the option to run either PICRUSt 1...
Read more >
Workflow Execution Service (WES) — Toil 5.8.0a1 ...
Starting a WES server¶ ; --work_dir WORKDIR ; The directory where workflows should be stored. This directory should be empty or only contain...
Read more >
2020/01/07 - 2019/07/01 - Legacy GATK Forum - Google Sites
How to add sample names in VCF · 070. Cohort mode of GermlineCNVCaller FileNotFoundError ... 094. Issue with paths running sample workflow.
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