I have 7 ghost tasks that are running but with no ...
# prefect-ui
d
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
go into the Interactive API tab and do a graphql query
Copy code
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
thanks! how would I go about cancelling the tasks, I have the ids
d
i typically just go corresponding webpage and
Set State
to Cancelled (or whatever)
Copy code
<https://cloud.prefect.io/><your-tenant>/task-run/<id from snippet above>
d
Yeah when I do that I get 404 not found, soo weird
even tried through graphql setTaskRunState and no help 😢
m
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
i think the problem is that flow run’s for this task was deleted. I’ve sent that email.
Copy code
mutation {
  setTaskRunState(input: {taskRunId: "9b724cde-0870-41a5-9f7b-f681e8c5d676", version: 2, state: "Cancelled"}) {
    id
  }
}
I was trying this but I was getting errors