I’m having an issue with prefect cloud. My agent i...
# ask-community
b
I’m having an issue with prefect cloud. My agent is running and nothing looks wrong in the logs, but for some reason when I try to run a flow with the same label as the agent the flow doesn’t run because it says there are no agents with the label I’ve specified. Any debugging suggestions would be much appreciated!
k
Hey @brian, could you show me the labels for the Flow and the agent? The most common issue I see is doing something like
Copy code
flow = Flow(
    "example",
    run_config=LocalRun(labels="dev")
)
when it should be a list of strings
Copy code
flow = Flow(
    "example",
    run_config=LocalRun(labels=["dev"])
)
upvote 1
b
Agent:
Copy code
[2021-12-06 15:06:24,978] INFO - prism-acuity-aks-agent | Starting KubernetesAgent with labels ['prism-acuity']
Flow:
Copy code
cron_clock = clocks.CronClock(
        cron="0 */12 * * *", start_date=start_date, parameter_defaults=None, labels=["prism-acuity"],
    )
I’m running the flow manually, and I see
prism-acuity
in the flow run UI
k
When you go to your
Agents
screen in the UI, do you see the agent you have running?
b
Yes, we had 2 agents with the same label for some reason I removed the one that was 3 days stale
But the one whose logs I’m tailing still doesn’t seem to pick up the flow run
k
Do you have more than 700 late runs by chance?
b
I’m still a bit new to prefect. Not sure how I would even figure that out tbh
nvm found it
We have only 1 late run
LoL it’s one of the ones I ran manually
I canceled that ^ and kicked off another manual run and it worked this time
k
This is pretty confusing. Seems like you ran Flows before too, so did this just stop working?
Ah ok that’s good. I think you should be good, but do ping if this still persists
👍 1
b
Any idea what that phantom agent in the UI could have been? What happens when a flow matches two agents it runs on both or it picks one?
k
The UI just keeps stale agents. You can hit Clean UP in the top right. This is because if you turn on an agent and turn it on again with the same name, it takes the same place as the stale agent. So we keep track of them match future agents and continue that Run History
Those agents are likely off if the Last Queried is more than a few minutes
b
I think it’s something wrong with the flow I’ve noticed that on the flow’s page in the UI I see the same “Label Problem” error If I delete the label when I create a run and add it back again, then everything is good Maybe there’s some whitespace in the label that isn’t rendering in the UI somehow?
k
I think whitespace should show. Could you try re-registering that? It is pretty weird
b
I re-registered it once this morning, but I can try again in a bit