https://prefect.io logo
Title
d

David Steiner Sand

03/29/2023, 8:24 PM
Hey everyone, I’m trying to start prefect flow runs through the REST API of a self hosted prefect server version 2.8.5. The flow run is created successfully but it gets stuck in the
Pending
state. If I cancel the flow run and
Retry
it, it works fine and gets to the state
Completed
. Here is the request I’m doing:
curl -X 'POST' \
  '<https://my-prefect-dns/api/deployments/09147238-fe73-488a-8ba5-b545cd648519/create_flow_run>' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{}'
I am doing something wrong?
b

Bianca Hoch

03/30/2023, 5:39 PM
Hey David, here's an article which outlines some good first-steps to take when a flow gets stuck in
Pending
. Typically that means there was an error with the flow run deployment.
d

David Steiner Sand

03/30/2023, 9:11 PM
Thanks for the response Bianca, but my problem doesn’t seem related to any of those topics, since the flow run only gets stuck in the
Pending
state when I create it from the REST API request. If I create it from the UI it works just fine. Also if I cancel it and retry it, it also works. Right after I do the curl requests, the agent does not log anything, so looks like the agent does not know about the flow run, therefore it never goes to
Running
. The agent only logs something when I trigger the flow run from the UI or using the CLI.
b

Bianca Hoch

04/03/2023, 2:56 PM
Hey David, thank you for the additional context! The team has taken a more detailed look at this behaviour and we have created an issue to address it.
d

David Steiner Sand

04/03/2023, 6:11 PM
Awesome, thanks you so much!
So until the issue is not solved, I imagine setting the state as SCHEDULED in the POST request’s body should solve it…
What a coincidence, the same problem was reported in the
cloud
channel in the same day (just saw it in the issue description): https://prefect-community.slack.com/archives/CM28LL405/p1680112687639159