0
votes

I've made a mistake in pipeline configuration and a job task is now stuck, waiting for a console input in a MS hosted ubuntu agent.

I don't care about the pipeline finishing so I canceled the pipeline but the job is still running, doing nothing, wasting number of running agents in the agent pool.

Is there a way to force cancel or shutdown the pipeline running in a hosted agent in Azure DevOps pipelines?

1
Do you still have this issue now? The jobs will be canceled according to your timeout settings if the job is blocked for a long time. Please refer to the document about timeouts. You can try to delete this run if canceling the pipeline does not work. If you still have this issue, please share your pipeline configuration for further troubleshooting.Walter
Deleting just makes the job disappear from the job list, it is still visible and running in the agent pool. The job timeouted after the default 60 minutes. I configured the timeouts but the pipeline takes 10-15 minutes to finish and I'm actively working on it, possibly going to produce a deadlock again. It would be really nice to be able to force stop the pipeline if I see the pipeline is deadlocked or not going the right direction.Mirek
Can you share your sample of your blocked pipeline so that I can test on my side? I tried to reproduce your issue in another way: condition:always(). Please check if you have set a similar condition. Currently the only way I found is to wait for job timeout. Cancel or delete pipeline also does not work on my side.Walter
I'm using terraform and I mistakenly forgot to fill in a variable in arguments. Terraform by default prompts for the value in stdin and that is what deadlocks the pipeline. I found that I can avoid the prompt with "-input=false" argument but the problem can be reduced to the single pipeline task like this: "- pwsh: Read-Host 'Tool behaving badly asking for prompts in automation'".Mirek
Hi @Mirek, Just checking in to see whether this issue is still blocking you now? Any update for this issue?Vito Liu

1 Answers

0
votes

As a workaround, we could set the job cannel time value to configure the cannel time, such as set the field value to 1.

Result:

If the job continues to run after we cancel the build, it will automatically cancel after one minute.

Check the pic below.

enter image description here