<@ULVA73B9P> getting The existing repository at /o...
# marvin-ai
a
@Marvin getting The existing repository at /opt/prefect/armor-adk-deployments-prefect does not match the configured repository when running a deployment
m
thought for 472.7 seconds
That error means the worker found a pre-existing Git repo at /opt/prefect/armor-adk-deployments-prefect whose “origin” does not match the repo configured on your deployment. Prefect refuses to pull from a different remote into the same directory. Sensible, if a bit grumpy. Why it happens - You previously ran a deployment from a different Git URL that cloned into the same path, then switched the deployment’s repo URL. - You’re running multiple deployments/repos but your work pool’s working_dir points to a common base so the repo-name folder collides. - Someone manually cloned a different repo into that path. Quick fixes - Nuke the stale checkout on the worker and retry:
Copy code
rm -rf /opt/prefect/armor-adk-deployments-prefect
- Or repoint the existing clone to the correct remote:
Copy code
cd /opt/prefect/armor-adk-deployments-prefect
git remote set-url origin <the-repo-url-configured-on-your-deployment>
git fetch
Prevent it going forward - Give each repo its own base working directory per work pool, or dedicate a pool per repo. - Update the pool’s base job template working_dir so clones don’t collide: 1) Inspect the pool:
Copy code
prefect work-pool inspect <your-pool>
2) Grab the default template and edit:
Copy code
prefect work-pool get-default-base-job-template --type process --file base.json
  # set "working_dir" to a base path you control, e.g. "/opt/prefect/repos"
  prefect work-pool update <your-pool> --base-job-template base.json
With a base like /opt/prefect/repos, Prefect clones each repo into a subfolder named after the repo, avoiding dropping it in /opt/prefect or some shared path that already contains a mismatched checkout. About templating working_dir - Base job templates support Jinja-style templating, so you can make paths unique per run or per deployment. For example:
Copy code
{
  "job_configuration": {
    "working_dir": "/opt/prefect/repos/{{ deployment.name }}/{{ flow_run.id }}"
  }
}
This avoids collisions entirely by isolating each run. If you don’t need per-run isolation, per-deployment is usually sufficient:
Copy code
"/opt/prefect/repos/{{ deployment.name }}"
If you share a host among many repos, I recommend: - One process work pool per repo, each with a distinct working_dir base (e.g., /opt/prefect/repos/<repo>), or - A single pool with a templated working_dir as above. If you can share: - Worker type (process, docker, kubernetes?) - The repo URL you configured on the deployment - Your work pool’s current base job template (working_dir) …I can propose an exact base.json you can drop in with
prefect work-pool update
. Docs, for reference (light reading): - Work pools and base job templates: https://docs.prefect.io/latest/deploy/ - Deploying from source overview: https://docs.prefect.io/latest/deploy/ Yes, the links are thrilling. Almost as thrilling as deleting a directory and watching the error go away.