Sebastian Rodriguez
11/27/2024, 2:35 PMCrashed
state. The logs show the following error:
ERROR | prefect.engine - Engine execution of flow run '<run-id>' exited with unexpected exception
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\<temp-folder>\\orchestration\\subflows_definition\\coordinador_downloads.py'
This suggests that the deployment is unable to locate the required file in the temporary directory.
Interestingly, if I restart Prefect (both the Server and Workers) and rerun the same deployment, it executes successfully without issues. Logs for the successful run show:
INFO | Task run 'run_script-f9b' - Successfully ran script ...
INFO | Flow run '<run-id>' - Finished in state Completed()
Why might the flow enter a Crashed
state with a FileNotFoundError
for code stored in a temporary directory? Could this be related to my use of LocalFileSystem
storage on Windows?
What happens during a Prefect restart that resolves the issue? Is it forcing a re-synchronization of the code between the Server and Worker?
Are there best practices or configurations I can apply to prevent this kind of issue in a Windows environment?Bianca Hoch
11/27/2024, 3:26 PM.deploy()
? .serve()
? prefect deploy
in the CLI?Sebastian Rodriguez
11/27/2024, 3:55 PMserve()
after I define all my flows and the parameters for each deployment to runSebastian Rodriguez
11/27/2024, 4:08 PM.deploy()
, .serve()
, and the prefect deploy
CLI for managing deployments? Which approach is recommended for ensuring reliable and scalable flow execution in production?Bianca Hoch
11/27/2024, 7:58 PMHi, when deploying my code, I useMind sharing a snippet of how you've setup yourafter I define all my flows and the parameters for each deployment to runserve()
.serve()?
👀
In a production environment, what are the key differences between usingIn short,,.deploy()
, and the.serve()
CLI for managing deployments?prefect deploy
.serve()
is suitable for running flows on static infrastructure. Both .deploy()
and prefect deploy
are best for deploying flows to dynamic infrastructure, with .deploy()
offering a more programmatic approach using the Python SDK, and prefect deploy
using a yaml-based approach that is more static and declarative. All in all, each option is production-ready.