Hi! After playing around a bit with the prefect 2-...
# ask-community
d
Hi! After playing around a bit with the prefect 2-beta i am now trying to get the public version up and running - but running into issues with the new deployment. My scenario is that i would like to build the deployments locally and have a VM (GCE) running as my agent. The problem is that when i am building the deployment file. my local path is hard-coded as a path - which results in an error when the agent tries to fetch the flow. Is there a way to solve this? Or is this a complete abuse of how it’s supposed to work?
1
Error message from the agent running in the VM:
Copy code
08:56:05.298 | ERROR   | Flow run 'chi667-adhil-cloud' - Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 246, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/usr/local/lib/python3.10/site-packages/prefect/client.py", line 105, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/prefect/deployments.py", line 55, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=None, local_path=".")
  File "/usr/local/lib/python3.10/site-packages/prefect/filesystems.py", line 98, in get_directory
    shutil.copytree(from_path, local_path, dirs_exist_ok=True)
  File "/usr/local/lib/python3.10/shutil.py", line 556, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/daniel/code/MarketingData'
The following path is from where i build the deployment on my local computer.
Copy code
'/Users/daniel/code/MarketingData'
o
I believe you need to define a remote storage block for this kind of scenario.
d
ah
o
Sorry, it's called a remote file system storage block. 😄
d
hehe, that explains the issue. I realize that i am missing the storage since the beta-releases..
Thanks! I will try that out
That solved the issue, thanks! 😃
🙌 1
o
No problem! 👍