https://prefect.io logo
Title
d

David George

09/14/2022, 2:14 PM
I have 7 ghost tasks that are running but with no flows, I can’t stop them and new flow runs are stuck due to us having task concurrency limits. Any ideas how I can go about stopping these task runs. (Prefect 1)
d

Darin Douglass

09/14/2022, 2:21 PM
go into the Interactive API tab and do a graphql query
query {
  task_run (where: {state: {_eq: "Running"},
                    task: {tags: {_contains: "<tag name>"}}}) {
    id
    flow_run{
      name
      id
    }
    task{
      name
      tags
    }
  }
}
:gratitude-thank-you: 1
🚀 1
then take the task run ids and cancel the running tasks manually
we’ve had this happen quite a few times but less so recently
d

David George

09/14/2022, 2:55 PM
thanks! how would I go about cancelling the tasks, I have the ids
d

Darin Douglass

09/14/2022, 2:57 PM
i typically just go corresponding webpage and
Set State
to Cancelled (or whatever)
<https://cloud.prefect.io/><your-tenant>/task-run/<id from snippet above>
d

David George

09/14/2022, 2:59 PM
Yeah when I do that I get 404 not found, soo weird
even tried through graphql setTaskRunState and no help 😢
m

Mason Menges

09/14/2022, 3:34 PM
Hey @David George would you be able to send in a request to help@prefect.io with the output from the query above, also what query are you running to set the task run states?
d

David George

09/14/2022, 4:10 PM
i think the problem is that flow run’s for this task was deleted. I’ve sent that email.
mutation {
  setTaskRunState(input: {taskRunId: "9b724cde-0870-41a5-9f7b-f681e8c5d676", version: 2, state: "Cancelled"}) {
    id
  }
}
I was trying this but I was getting errors