Hey team - since the outage, my flows are all of a...
# ask-community
m
Hey team - since the outage, my flows are all of a sudden unable to find the .py files in S3 which they are getting the script from. I will put the error in the thread.
Copy code
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "<frozen importlib._bootstrap_external>", line 879, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1016, in get_code
  File "<frozen importlib._bootstrap_external>", line 1073, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/YYY/XXX.py'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/engine.py", line 276, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/client/utilities.py", line 40, in with_injected_client
    return await fn(*args, **kwargs)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/deployments.py", line 217, in load_flow_from_flow_run
    flow = await run_sync_in_worker_thread(load_flow_from_entrypoint, str(import_path))
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 91, in run_sync_in_worker_thread
    return await anyio.to_thread.run_sync(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/flows.py", line 809, in load_flow_from_entrypoint
    flow = import_object(entrypoint)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 201, in import_object
    module = load_script_as_module(script_path)
  File "/opt/pysetup/.venv/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 164, in load_script_as_module
    raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at 'XXX.py' encountered an exception: FileNotFoundError(2, 'No such file or directory')
Local deploy has not been working well. The files are shown as updated in S3.
I have confirmed the s3 block is referencing the proper bucket, checked the file in S3 and confirmed it is updated, however the container still cannot find the file
It's searching for the file at the working director of my container. It must not be mounting the file properly when spinning up the container
a
I'm also having some similar issues just now cropping up in pulling from
s3
, maybe they are related https://prefect-community.slack.com/archives/C048SVCEFF0/p1686882504583129
m
Yep same issue here
Slightly different issue actually 🙂