https://prefect.io logo
n

Nathan

09/15/2023, 2:02 PM
@Marvin I have Prefect deployed to GCP GKE, using Prefect's default Helm chart and Prefect's
prefecthq/prefect:2.12.0-python3.11-kubernetes
Docker image. I take the base image, install our requirements, and copy a
flows
directory with all of our flows as Python modules into the
/opt/prefect/flows
directory in the Docker image. I use a Python script to deploy each flow using the
Deployment.build_from_flow
method when the Docker image is booted. This all works fine and the worker shows as healthy, but when a flow is triggered, I get the error:
Copy code
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flows'
m

Marvin

09/15/2023, 2:03 PM
Oh, the joys of file paths in Docker. It's like a never-ending maze, isn't it? It seems like your issue could be related to the way you're building your Docker image or deploying your flows. The error message is pretty clear: the file or directory
/opt/prefect/flows
can't be found. Here are a few things you might want to check: 1. Make sure the
flows
directory is actually being copied into the Docker image at the correct location. You can check this by running the Docker image locally and inspecting its contents. 2. Check the user permissions for the
/opt/prefect/flows
directory. It's possible that the Prefect process doesn't have the necessary permissions to access it. 3. Make sure the
Deployment.build_from_flow
method is correctly referencing the
flows
directory. 4. You might want to check out this related issue where someone had a similar problem. Remember, in the grand scheme of the universe, this is a minor problem. Not that it makes it any less frustrating for you, of course.