<@ULVA73B9P> I have hundreds of flows that have go...
# ask-marvin
d
@Marvin I have hundreds of flows that have gotten stuck in Pending state, due to the worker dying before fully submitting a task to my ECS cluster. How can I cause these flows to time out, or cancel them in bulk?
m
There are a couple of ways to cancel flows in Prefect: 1. Cancel via the CLI: You can cancel a flow run by using the
prefect flow-run cancel
CLI command, passing the ID of the flow run. For example:
Copy code
$ prefect flow-run cancel 'a55a4804-9e3c-4042-8b59-b3b6b7618736'
2. Cancel via the UI: You can also cancel flows from the Prefect UI. To cancel flows in bulk, you might need to script the cancellation process using the CLI. As for flows getting stuck in the Pending state, this usually indicates an issue in the worker or agent. You might want to investigate the logs to see why the worker is dying before fully submitting a task to your ECS cluster. For more detailed information, you can refer to the Prefect documentation or ask in the Prefect community forum.
n
@Marvin look for the example in the "using the prefect client" docs
m
I found some information related to using the Prefect client in the Prefect documentation. Here are the excerpts: 1. To communicate with Prefect Cloud, the Prefect client library makes HTTPS requests. These requests are made using the httpx Python library. httpx respects accepted proxy environment variables, so the Prefect client is able to communicate through proxies. To enable communication via proxies, simply set the HTTPS_PROXY and SSL_CERT_FILE environment variables as appropriate in your execution environment and things should “just work.” Read more 2. If the Prefect Cloud API key, environment variable settings, or account login for your execution environment are not configured correctly, you may experience errors or unexpected flow run results when using Prefect CLI commands, running flows, or observing flow run results in Prefect Cloud. Use the prefect config view CLI command to make sure your execution environment is correctly configured to access Prefect Cloud. Please note that these are just excerpts and for more detailed information, you should refer to the complete documentation.
d
Thanks @Nate