Skip to content

jenkins-cli.jar build command with -s flag aborts long-running builds after Jenkins LTS upgrade from 2.479.1 to 2.541.2 #26862

@rshmanuka24

Description

@rshmanuka24

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions