Hi, With the upgrade to prefect >=2.14.11, the flo...
# ask-community
a
Hi, With the upgrade to prefect >=2.14.11, the flow run cannot find deployments. We are using local storage. Here are the logs if you could please help: Currently with pinned prefect & pendulum versions
prefect==2.10.21
,
pendulum==2.1.2
While deploying flow:
Entrypoint: transform/python/cdpprefect/flows/portfolio_rollup/portfolio_rollup_flow.py:portfolio_rollup_flow
Path: transform/python/cdpprefect/flows/portfolio_rollup
On running the flow, flow run successful:
Flow run 'spectral-heron' - Downloading flow code from storage at 'transform/python/cdpprefect/flows/portfolio_rollup'
On unpinning prefect:
prefect>=2.14.11
While deploying flow:
Entrypoint: transform/python/cdpprefect/flows/portfolio_rollup/portfolio_rollup_flow.py:portfolio_rollup_flow
Path: transform/python/cdpprefect/flows/portfolio_rollup
On running flow, unsuccessful:
11:55:33.716 | INFO    | Flow run 'imposing-swift' - Downloading flow code from storage at 'transform/python/cdpprefect/flows/portfolio_rollup'
11:55:33.915 | ERROR   | Flow run 'imposing-swift' - Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/prefect/engine.py", line 414, in retrieve_flow_then_begin_flow_run
flow = await load_flow_from_flow_run(flow_run, client=client)
File "/usr/local/lib/python3.10/dist-packages/prefect/client/utilities.py", line 51, in with_injected_client
return await fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/prefect/deployments/deployments.py", line 235, in load_flow_from_flow_run
await storage_block.get_directory(from_path=from_path, local_path=".")
File "/usr/local/lib/python3.10/dist-packages/prefect/filesystems.py", line 162, in get_directory
copytree(from_path, local_path, dirs_exist_ok=True, ignore=ignore_func)
File "/usr/lib/python3.10/shutil.py", line 557, in copytree
with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: '/prefect/agent/transform/python/cdpprefect/flows/portfolio_rollup/transform/python/cdpprefect/flows/portfolio_rollup'
11:55:38.897 | INFO    | prefect.infrastructure.process - Process 'imposing-swift' exited cleanly.
If we look at the FileNotFoundError, it has duplicated the path
transform/python/cdpprefect/flows/portfolio_rollup
But even if I remove the path while deploying the flow, it still gives the same error. Looks like related to https://github.com/PrefectHQ/prefect/issues/11295 but wanted to check if there is a way to upgrade the version and work around the path error if we are using local storage. Thanks Asmita @Milly gupta