hello, need help on understanding/troubleshooting:...
# best-practices
y
hello, need help on understanding/troubleshooting: I have just deployed a new agent. call it agent b on top of agent a (current agent) to my prefect server (version 2) (self hosted) all on rancher. I am able to deploy the flow in agent b cli, and it appears in the ui of prefect server, however when i trigger the run, it says
Flow could not be retrieved from deployment. FileNotFoundError: [Errno 2] No such file or directory
I am suspecting it is not looking in the right agent. My questions: 1. How does prefect server knows which agent to search from when a run happens? 2. How to troubleshoot to check if a flow is trying to get the code from the right agent?
1
versions on agent:
Copy code
>prefect version
Version:             2.10.2
API version:         0.8.4
Python version:      3.9.16
OS/Arch:             linux/x86_64
Profile:             default
Server type:         server
o
Hey, have you looked into work pools/queues?
y
the flows are on the right queue
do you need a different work pool for each agent?
o
If you want certain deployments to only be picked up by a specific agent, yes. Otherwise no.
I'm guessing that's what you want, based on what you wrote
Otherwise both agents will check if there is something for them to do and Prefect will give the job to whoever polled first.
y
so agent b has a different set of flows than agent a, they should be polling different work pool?
o
Unless I'm misunderstanding what you're trying to do, yeah. It's the only way you have to control which agent runs what flow
👍 1
y
thanks. lemme try
👍 1
o
By the way, maybe this is nitpicking but it might help you figuring out how things work: "How does prefect server knows which agent to search from when a run happens?" The server doesn't send job to any agents, it just puts them in pools/queues. It's the agent that then poll the pools/queues you told it to poll every x seconds to check if there is work to do.
👍 2
y
works now! thanks for the help
o
That's great! No problem. 🙂