Jenkins and plugins versions report
After upgrading Jenkins LTS from 2.479.1 to 2.541.2, all builds triggered via jenkins-cli.jar using the -s flag (wait for completion) are being aborted mid-run after the build has been running for a period of time. Builds triggered without -s complete successfully, confirming the issue is specific to the CLI wait/monitor behavior.
The -f flag (stream console output) doesn't provide success or failure status. And due to our project restrictions websocket cli methods can't be used.
What Operating System are you using (both controller, and any agents involved in the problem)?
Controller:
- Linux (os.version=5.15.0-177-generic, amd64)
- Java 21
Agents:
- Linux (Java 21) & Docker
- Windows 11 (Java 21)
Reproduction steps
Upgrade Jenkins LTS from 2.479.1 to 2.541.2
Trigger a long-running build using the CLI with the -s flag:
java.exe -jar jenkins-cli.jar -s https://<JENKINS_URL>/ -http -auth : build <JOB_NAME> -s # Observe that the build starts successfully but is aborted after running for some time.
Expected Results
The CLI should hold the connection open until the build completes and return the final build result (SUCCESS / FAILURE) with the appropriate exit code.
Actual Results
The build is aborted mid-execution. The CLI disconnects an job aborted before the build finishes.
Started <JOB_NAME> #X
ERROR: null
Anything else?
No response
Are you interested in contributing a fix?
No response
Jenkins and plugins versions report
After upgrading Jenkins LTS from 2.479.1 to 2.541.2, all builds triggered via jenkins-cli.jar using the -s flag (wait for completion) are being aborted mid-run after the build has been running for a period of time. Builds triggered without -s complete successfully, confirming the issue is specific to the CLI wait/monitor behavior.
The -f flag (stream console output) doesn't provide success or failure status. And due to our project restrictions websocket cli methods can't be used.
What Operating System are you using (both controller, and any agents involved in the problem)?
Controller:
Agents:
Reproduction steps
Upgrade Jenkins LTS from 2.479.1 to 2.541.2
Trigger a long-running build using the CLI with the -s flag:
java.exe -jar jenkins-cli.jar -s https://<JENKINS_URL>/ -http -auth : build <JOB_NAME> -s # Observe that the build starts successfully but is aborted after running for some time.
Expected Results
The CLI should hold the connection open until the build completes and return the final build result (SUCCESS / FAILURE) with the appropriate exit code.
Actual Results
The build is aborted mid-execution. The CLI disconnects an job aborted before the build finishes.
Started <JOB_NAME> #X
ERROR: null
Anything else?
No response
Are you interested in contributing a fix?
No response