# If Azure Batch has an issue, a Run can be stuck in the Running state indefinably

**URL:** https://community.seqera.io/t/if-azure-batch-has-an-issue-a-run-can-be-stuck-in-the-running-state-indefinably/2134
**Category:** Ask for help
**Created:** [May 17, 2025, 2:43am UTC](https://community.seqera.io/t/if-azure-batch-has-an-issue-a-run-can-be-stuck-in-the-running-state-indefinably/2134 "2025-05-17T02:43:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![qup9](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/qup9/32/512_2.png) [@qup9](https://community.seqera.io/u/qup9)
#### Post date: [May 17, 2025, 2:43am UTC](https://community.seqera.io/t/if-azure-batch-has-an-issue-a-run-can-be-stuck-in-the-running-state-indefinably/2134/1 "2025-05-17T02:43:56Z")

</div>

Seqera Tower:  
If Azure Batch has an issue, a Run can be stuck in the Running state indefinably.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/seqera/original/2X/e/efebf8e99cd74d492cc358f0f405602eda80391a.png)  
There is no way to terminate it:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/seqera/original/2X/9/9f869e92c6be4001fe88a7ea823bf7d775ca2dc9.png)  
Cancel is not available as an option.

tried solution described in [Zombie runs, jobs has been killed in local but state is still running on Seqera - #3 by alanwilter](https://community.seqera.io/t/zombie-runs-jobs-has-been-killed-in-local-but-state-is-still-running-on-seqera/921/3)

```auto
import requests

headers = {
  "Authorization": f"Bearer {vars.get_var('TOWER_ACCESS_TOKEN')}", 
  "Accept": "application/json",
  "Content-Type": "application/json"
}
workflow_id = '4XYno27K7Waw3X'
payload = {
  "workflowIds": [
	  workflow_id
  ]
}
url ="'https://api.cloud.seqera.io/workflow/delete?workspaceId=77936274224094&force=true'"

response = requests.post(url,json=payload, headers=headers)

```

Respose:

b’{“message”:“Unable to cancel workflow with id: 4XYno27K7Waw3X - reason: Status code 409, {\r\n \“odata.metadata\”:\“[https://nextflow35a68628.westus.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element\\",\\“code\\”:\\“JobCompleted\\”,\\"message\\](https://nextflow35a68628.westus.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element%5C%5C%22,%5C%5C%22code%5C%5C%22:%5C%5C%22JobCompleted%5C%5C%22,%5C%5C%22message%5C%5C)”:{\r\n \“lang\”:\“en-US\”,\“value\”:\“The specified job is already in a completed state.\\nRequestId:2e0880a3-d3fd-4e61-b07e-69a8582fd446\\nTime:2025-05-17T02:35:02.7352551Z\”\r\n }\r\n}”}’

To reproduce, start an azure batch run.  
While it is running terminate the batch node.  
Workflow’s will be left in orphan state and not cancel-able or delete-able.

This is legit issue, because if the node runs out of space it gets stuck in a hung state and must be manually terminated. If you forget to cancel Seqera Jobs first, you are stuck. In my case I have code that limits the concurrent Seqera runs, but jobs are stuck running.

The only way I could fix this was to delete the workspace - luckily, I don’t care about old runs. Others will. This also forced me to rebuild my environment - timeconsuming.
