<@ULVA73B9P> Hi. I have redeployed some flows that...
# ask-marvin
p
@Marvin Hi. I have redeployed some flows that I had deployed earlier and were working, in order to make the deployment cleaner and automated, and I find myself with flows that are not starting (permanent "pending" state). Ask me any questions you would need to answer to this problem, and then guide me through the steps to debug it
m
It seems you've encountered a common issue where flows remain in a "pending" state. Let's gather some information to diagnose the problem effectively: 1. Environment Details: Are you using Prefect 3.x, and what kind of deployment environment are you using (e.g., Local, Kubernetes, Cloud)? 2. Logs and Error Messages: Are there any error messages or logs available that might give hints about why the flows are pending? 3. Agent Status: Is the Prefect agent running and properly connected to your deployment environment? The agent is responsible for picking up and executing the flow runs. 4. Configuration Changes: Have there been any recent changes to your configuration or infrastructure settings? 5. Flow Registration: Were the flows registered successfully after redeployment? Once I have more information, I can guide you through the steps to resolve this issue.
p
I have Prefect 2.20.16, and it's running on AWS EKS with a core deployment, not cloud. Logs don't show any error messages, the last info log says
Downloading flow code from storage at '.'
. This is consistent with other flows that have been deployed the same way and that work. The deployment is done with a CI/CD pipeline and it's the same process for all flows. The agent is running properly because some flows launch seamlessly. No particular configuration changes, and flows are correctly registered
@Marvin I have Prefect 2.20.16, and it's running on AWS EKS with a core deployment, not cloud. Logs don't show any error messages, the last info log says
Downloading flow code from storage at '.'
. This is consistent with other flows that have been deployed the same way and that work. The deployment is done with a CI/CD pipeline and it's the same process for all flows. The agent is running properly because some flows launch seamlessly. No particular configuration changes, and flows are correctly registered
m
Based on the information gathered, here are some potential causes and steps to debug your issue with flows remaining in a "pending" state: 1. Module Imports and Deployments: One potential issue could be related to how modules are imported in your deployment scripts. If multiple flows import modules where other deployments are defined, it might cause conflicts leading to flows getting stuck in a "pending" state. Review your deployment scripts to ensure that module imports are not causing conflicts. GitHub Issue Reference. 2. Agent Configuration: Ensure that your agent is correctly configured to pick up the work queues. Sometimes, agents may not poll the correct queue if there are mismatches in queue names or configurations. Check your agent's configuration and ensure it's set to poll the correct queues. Agent Documentation. 3. Flow Rescheduling: If the flow runs are stuck, you might want to consider rescheduling them programmatically. You can use Prefect’s client to delete the stuck flow runs and create new ones. This can be done using a script that interacts with the Prefect API. Client API Reference. 4. Infrastructure Delays: Sometimes, infrastructure setup might take longer than expected, causing delays. You can adjust the
--prefetch-seconds
setting to give more time for the infrastructure to be ready before running the flow. Given these points, I recommend checking your deployment scripts for any import conflicts, verifying agent configurations, and considering rescheduling stuck flows using the Prefect client. If the issue persists, you might want to look into infrastructure delays or consult the Prefect community for more insights.