Georg Raiser
08/20/2025, 4:06 PMDownloading flow code from storage at '.'
. There is no other error output as far as I can see, neither from the server nor from the workers
what could be the reason?Marvin
08/20/2025, 4:06 PMMarvin
08/20/2025, 4:14 PMfrom prefect import flow
from prefect.docker import DockerImage
@flow
def my_flow(): ...
my_flow.deploy(
name="my-deployment",
work_pool_name="docker-pool",
image=DockerImage(name="your-repo/prefect-flows:latest"),
build=True,
push=True, # bake the code into the image
)
- Or via CLI, run prefect deploy
from your project using a Docker work pool so the build step copies the project into the image.
- Or fetch code at runtime from a repo instead of “.”:
from prefect import Flow
Flow.from_source(
"<https://github.com/your-org/your-repo.git>",
entrypoint="flows/etl.py:etl",
).deploy(name="etl", work_pool_name="docker-pool")
- If you must keep LocalFileSystem, ensure the container has the project directory mounted at the same path and you aren’t copying a massive tree.
Docs: Store flow code, Docker deployments
2) Missing git in the image
- Symptom: Using Flow.from_source(...) with a Git URL, but the container never finishes “downloading”.
- Fix: Install git in your image:
- Debian/Ubuntu:
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
- Alpine:
RUN apk add --no-cache git
3) Private repo with no credentials or SSH host key prompts
- Symptom: Git “hangs” waiting for credentials/host verification; logs don’t show much.
- Fix:
- Use HTTPS with a token (prefer passing credentials securely, not in the URL), or configure SSH properly (keys + known_hosts).
- For HTTPS tokens, see Prefect’s GitHub integration: https://docs-3.prefect.io/integrations/prefect-github/
- If using SSH, add known host in the image to avoid interactive prompts:
RUN mkdir -p /root/.ssh && ssh-keyscan <http://github.com|github.com> >> /root/.ssh/known_hosts
4) You’re syncing way too much code
- Symptom: It “hangs” because Prefect is copying a huge directory (node_modules, data dumps, etc.).
- Fix: Use a .prefectignore to exclude large/unnecessary paths.
- Docs: https://docs-3.prefect.io/v3/how-to-guides/deployments/store-flow-code#project-files-to-include
5) Symlink nightmares
- Symptom: Copy step loops or chokes on symlinks, especially when copying “.” to “.”.
- Fix: Avoid symlinks into large external dirs; exclude them with .prefectignore or switch to baking code into the image or pulling from Git.
Quick diagnostics
- Inspect the deployment to see storage/source:
prefect deployment inspect "your-flow/your-deployment"
If you see LocalFileSystem with path “.”, that’s your smoking gun.
- Turn up logs in the container:
PREFECT_LOGGING_LEVEL=DEBUG
- If using from_source, exec into the container and try git clone
manually to confirm git and auth.
If you can share:
- Prefect version
- How you created the deployment (CLI vs. Flow.from_source, any code or command you used)
- The output of prefect deployment inspect "flow/deployment"
- What base image you’re using (and whether git is installed)Marvin
08/20/2025, 4:14 PM