jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-51727] Pipeline bat stuck on Windows Server when mixed agents used

Open
#428 0 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Hi,

We have our Jenkins master in Kubernetes cluster on Linux.

We created windows agent and connected it to master.

Declarative pipeline is used and problems occurs with definition below:

 pipeline {

agent {
kubernetes {
label 'worker'
defaultContainer 'jnlp'
inheritFrom 'jnlp-custom'
}
}
options {
timestamps()
skipStagesAfterUnstable()
}
triggers {
pollSCM('')
}
stages {
stage("build windows"){
agent {
label "windows"
}
when {
branch 'windows'
}
steps{
bat "ping 127.0.0.1"
}
}
}

}

Code is correctly checkout to workspace on windows agent, but then job hangs indefinitely on:

Running batch script

Problem does not occur when we change agent to none:

pipeline {

agent none
options {
timestamps()
skipStagesAfterUnstable()
}
triggers {
pollSCM('')
}
stages {
stage("build windows"){
agent {
label "windows"
}
when {
branch 'windows'
}
steps{
bat "ping 127.0.0.1"
}
}
}

}

 

---
Originally reported by adiq, imported from: Pipeline bat stuck on Windows Server when mixed agents used


  • status: Open
  • priority: Major
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

Hi,

We have our Jenkins master in Kubernetes cluster on Linux.

We created windows agent and connected it to master.

Declarative pipeline is used and problems occurs with definition below:


 pipeline {

agent {
kubernetes {
label 'worker'
defaultContainer 'jnlp'
inheritFrom 'jnlp-custom'
}
}
options {
timestamps()
skipStagesAfterUnstable()
}
triggers {
pollSCM('')
}
stages {
stage("build windows"){
agent {
label "windows"
}
when {
branch 'windows'
}
steps{
bat "ping 127.0.0.1"
}
}
}

}


Code is correctly checkout to workspace on windows agent, but then job hangs indefinitely on:


Running batch script


Problem does not occur when we change agent to none:


pipeline {

agent none
options {
timestamps()
skipStagesAfterUnstable()
}
triggers {
pollSCM('')
}
stages {
stage("build windows"){
agent {
label "windows"
}
when {
branch 'windows'
}
steps{
bat "ping 127.0.0.1"
}
}
}

}


 

environment

```
Jenkins 2.107.3

Windows Server 2008 R2

Linux/Kubernetes
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.