Hi all. I am completely new to prefect and I am fa...
# ask-community
a
Hi all. I am completely new to prefect and I am facing an issue. I have a prefect docker agent deployed. A flow attached to it shall be triggered when an input is passed and the flow shall be immediately set to run state. It's been working perfectly fine until yesterday I observed the flows are in the scheduled state infinitely. SO every new input keeps adding new fllow runs but all into an infinitely scheduled state. Any inputs would be helpful. Thanks in advance.
👀 1
a
What labels did you configure on your agent and on your flow? those need to match. The most common issue for being stuck in a Scheduled state is a label mismatch
a
Thanks but the labels on the agent and the flow match. Is it compulsory to do the flow.build() after storing the flow locally as a docker?
a
it depends on whether you store your flow pickled or as script: https://docs.prefect.io/orchestration/flow_config/storage.html#pickle-vs-script-based-storage You can take a look at those examples: 1. Here we store it pickled and the storage gets built upon registration: https://github.com/anna-geller/packaging-prefect-flows/blob/master/flows/docker_pickle_docker_run_local_image.py 2. Here we store it as script because we’ve already built the image which contains the flow files baked into the image, thus we pass
build=False
on registration: https://github.com/anna-geller/packaging-prefect-flows/blob/master/flows_no_build/docker_script_docker_run_local_image.py
a
Thanks. I'll take a look at these.
👍 1
I am using the script based storage. So the code I use seems to be fine. But the infinite scheduling still persists. What else do you suggest I look into?
a
Can you share: 1. How you started the agent? 2. Is your agent still healthy? Can you confirm that? 3. How do you set your run configuration on the flow? A code snippet incl. labels would be great. 4. You said you used a script based storage - can you confirm that the base image is an official PrefectHQ image, and that the flow file has been copied to the image? Feel free to DM me your Dockerfile if you don’t want to share in the channel. 5. Do you use Prefect Cloud or Server? 6. Does Prefect version match between your Docker agent and the machine from which you register the flow? Which Prefect version is it? 7. Is your API key that you used to authenticate the agent still valid? Cross-checking it would be great. 8. Do you have flow concurrency limits set on the Flow that is stuck in a Scheduled state? If so, how high is the limit? This is useful to know because if you have e.g. concurrency limit of 1 and you try to run a second flow run of this flow, it may be stuck in a Scheduled state until the other flow run finishes. Once you answer those questions (ideally, please number your answers to match with questions 🙏), we can estimate what may be the cause and fix the issue. If some of those questions are not clear, LMK, I can explain.
upvote 1