Hi all! We have a prefect agent that is scheduling...
# ask-community
w
Hi all! We have a prefect agent that is scheduling flows when we tell it to schedule them, but then they just sit in a "Scheduled" state when we run a command like
prefect get flow-runs -f myflow
. We also see a few runs with
Success
,
Failed
, and
Cancelled
as well. I don't know how someone got a flow to cancel though.
Is there something we might need to do to force a flow to start if it's in the scheduled state?
And are there reasons why this kind of "stuck state" might occur?
k
Hey @William Grim, this is most likely a label issue. Agents can only pick up flows that matching labels. The flow labels need to be a subset of the agent labels for the flow to be picked up. Here is the docs for that.
Note there are default labels attached for Local Flow and Local Storage. You can remove them if you want by doing
flow.storage = Local(..., add_default_labels=False)
w
Thank you @Kevin Kho. I've passed that to my team so we can look over the weekend. This sounds promising, and we will do some investigation. We have debug logs enabled properly but weren't seeing any output.
👍 1
I really appreciate it and will follow up later.
@Kevin Kho yet again, I forgot to follow up on this. I'm sorry for that. You were right in the above, and it was a labeling issue. Once we added the right labels and lined them up with our prefect agent start cmd, everything started working again.
k
No worries. I just assume it worked if you don’t come back haha. Thanks for coming back.
❤️ 1