plynx-team / plynx

PLynx is a domain agnostic platform for managing reproducible experiments and data-oriented workflows.
https://plynx.com
Apache License 2.0
301 stars 37 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '/data/resources/<uuid>' #127

Closed fwanghe closed 2 years ago

fwanghe commented 2 years ago

Hi,

I came across an issue when trying to run a small workflow with example nodes 'Get nameandPrint message` as below image

When I click on the Run button then I got the log below from the worker

workers_1   | INFO:root:New node found: 625e0a8ce83a4ab02806afe8 RUNNING New DAG workflow
api         | INFO:werkzeug:172.24.0.1 - - [19/Apr/2022 01:04:12] "OPTIONS /plynx/api/v0/runs/625e0a8ce83a4ab02806afe8 HTTP/1.1" 200 -
api         | INFO:werkzeug:172.24.0.1 - - [19/Apr/2022 01:04:12] "GET /plynx/api/v0/runs/625e0a8ce83a4ab02806afe8 HTTP/1.1" 200 -
workers_1   | INFO:root:Initializing executor `python-workflow`
workers_1   | INFO:root:Initializing executor `basic-file`
workers_1   | INFO:root:Initializing executor `basic-bash-jinja2-operation`
workers_1   | INFO:root:Initializing executor `basic-python-node-operation`
workers_1   | INFO:root:Initializing executor `python-code-operation`
workers_1   | INFO:root:Initializing executor `basic-dag-operation`
workers_1   | INFO:root:Initializing executor `dummy`
workers_1   | INFO:root:Created pool worker
workers_1   | INFO:root:Created pool worker
workers_1   | INFO:root:Created pool worker
workers_1   | INFO:root:Execute Node(625e0a8ce83a4ab02806afe9) Get name
workers_1   | INFO:root:Node running status SUCCESS Get name
workers_1   | INFO:root:Execute Node(625e0a8ce83a4ab02806afea) Print message
workers_1   | ERROR:root:Job failed with traceback: Traceback (most recent call last):
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/plugins/executors/python/dag.py", line 126, in worker_main
workers_1   |     res = func(**prep_args(node))
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/plugins/executors/python/dag.py", line 101, in __exit__
workers_1   |     with plynx.utils.file_handler.open(filename, "w") as f:
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/utils/file_handler.py", line 23, in open
workers_1   |     return smart_open.open(cld_filename, mode)
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 195, in open
workers_1   |     newline=newline,
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 361, in _shortcut_open
workers_1   |     return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs)
workers_1   | FileNotFoundError: [Errno 2] No such file or directory: '/data/resources/79f682c3-09b6-42ed-89b7-7b076166613d'
workers_1   | 
workers_1   | Exception in thread Thread-4:
workers_1   | Traceback (most recent call last):
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/plugins/executors/python/dag.py", line 126, in worker_main
workers_1   |     res = func(**prep_args(node))
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/plugins/executors/python/dag.py", line 101, in __exit__
workers_1   |     with plynx.utils.file_handler.open(filename, "w") as f:
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/utils/file_handler.py", line 23, in open
workers_1   |     return smart_open.open(cld_filename, mode)
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 195, in open
workers_1   |     newline=newline,
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 361, in _shortcut_open
workers_1   |     return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs)
workers_1   | FileNotFoundError: [Errno 2] No such file or directory: '/data/resources/79f682c3-09b6-42ed-89b7-7b076166613d'
workers_1   | 
workers_1   | During handling of the above exception, another exception occurred:
workers_1   | 
workers_1   | Traceback (most recent call last):
workers_1   |   File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
workers_1   |     self.run()
workers_1   |   File "/usr/local/lib/python3.7/threading.py", line 870, in run
workers_1   |     self._target(*self._args, **self._kwargs)
workers_1   |   File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 105, in worker
workers_1   |     initializer(*initargs)
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/plugins/executors/python/dag.py", line 134, in worker_main
workers_1   |     with plynx.utils.file_handler.open(err_filename, "w") as f:
workers_1   |   File "/usr/local/lib/python3.7/site-packages/plynx-1.7.8-py3.7.egg/plynx/utils/file_handler.py", line 23, in open
workers_1   |     return smart_open.open(cld_filename, mode)
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 195, in open
workers_1   |     newline=newline,
workers_1   |   File "/usr/local/lib/python3.7/site-packages/smart_open-5.2.1-py3.7.egg/smart_open/smart_open_lib.py", line 361, in _shortcut_open
workers_1   |     return _builtin_open(local_path, mode, buffering=buffering, **open_kwargs)
workers_1   | FileNotFoundError: [Errno 2] No such file or directory: '/data/resources/6199d318-f181-4549-8f88-170ae1166f36'
workers_1   | 
workers_1   | INFO:root:Created pool worker

It looks like the log files didn't get written properly. Not sure if any one had the same issue.

The steps of reproducing the issue are as below( pretty much as same as what described in the README.md) steps:

  1. running the stack with docker with commands below
    cp template_config.yaml config.yaml                 # Make a copy of a config
    make up                                             # to start production services
  2. Go Worksflows -> Python Workflow, then drag Get name and Print message to the canvas and link both together. Save, Validate and Click Run button.
khaxis commented 2 years ago

Thanks good description on how to reproduce!

Short fix, in the plynx directory create a new folder:

mkdir -p ./data/resources

fwanghe commented 2 years ago

thanks for the help. close the issue now