Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15339

Node Label Parameter plugin breaks Windows batch file build steps if Name field not filled in

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • I am running Jenkins 1.480 with the master installed on a Windows 7 machine although I suspect this problem will be the same if I was using a linux master. Only affects build steps on Windows slaves.
    • 1.7.3

      When using the Node Label Parameter plugin it breaks any build steps that run Windows batch files if you don't fill in a value for the Name field.

      To reproduce, create a new free style job and select the "This build is parameterized" option. Select a default slave that is a windows machine. Leave the Name field empty.

      Add a build step to run a Windows batch file and fill in a simple command like echo %PATH% or ver. When you run the job the build step will fail with an error message like this:

      Building remotely on WINDOWS_SERVER in workspace C:\jenkins\workspace\update-scripts-all-slaves
      [update-scripts-all-slaves] $ cmd /c call C:\Users\JENKIN~1.SIM\AppData\Local\Temp\hudson7760734931475434766.bat
      The parameter is incorrect
      FATAL: command execution failed
      java.io.IOException: Cannot run program "cmd" (in directory "C:\jenkins\workspace\update-scripts-all-slaves"): CreateProcess error=87, The parameter is incorrect
      at java.lang.ProcessBuilder.start(Unknown Source)
      at hudson.Proc$LocalProc.<init>(Proc.java:244)
      at hudson.Proc$LocalProc.<init>(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
      at hudson.Launcher$ProcStarter.start(Launcher.java:338)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:934)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:901)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:60)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.<init>(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 17 more
      Build step 'Execute Windows batch command' marked build as failure

      This only happens if you leave the Name field empty as I originally did. It also only affects Windows batch files, linux shell command build steps work as expected even with an empty Name field.

          [JENKINS-15339] Node Label Parameter plugin breaks Windows batch file build steps if Name field not filled in

          Daniel Beck added a comment -

          Which version of the plugin are you using?

          Daniel Beck added a comment - Which version of the plugin are you using?

          My apologies, the version I gave initially was wrong. Running on Jenkins version 1.580.3 and Node and Label parameter plugin 1.5.1

          Naraen Sridharan added a comment - My apologies, the version I gave initially was wrong. Running on Jenkins version 1.580.3 and Node and Label parameter plugin 1.5.1

          I confirm this bug using:

          • Jenkins 1.609.2
          • Environment Injector Plugin 1.91.4
          • Node and Label parameter plugin 1.5.1

          Giacomo Boccardo added a comment - I confirm this bug using: Jenkins 1.609.2 Environment Injector Plugin 1.91.4 Node and Label parameter plugin 1.5.1

          Kevin Phillips added a comment - - edited

          I have confirmed this bug is reproducible in Jenkins LTS v1.596.3 as well, so I would like to see the fix backported to the LTS edition as well.

          Also, I can confirm the bug is reproducible on Windows as well since our Jenkins master runs on a Windows 7 host.

          Kevin Phillips added a comment - - edited I have confirmed this bug is reproducible in Jenkins LTS v1.596.3 as well, so I would like to see the fix backported to the LTS edition as well. Also, I can confirm the bug is reproducible on Windows as well since our Jenkins master runs on a Windows 7 host.

          I confirm this bug using:

          • Jenkins LTS 1.625.3 on Linux
          • Node and Label parameter plugin 1.7.1
          • Environment Injector Plugin 1.92.1

          I get this error even when I have selected a node while doing Maven builds on Windows. However, when I run a batch script on Windows (again, selecting a node from the parameters), everything is fine.

          Peter Costantinidis added a comment - I confirm this bug using: Jenkins LTS 1.625.3 on Linux Node and Label parameter plugin 1.7.1 Environment Injector Plugin 1.92.1 I get this error even when I have selected a node while doing Maven builds on Windows. However, when I run a batch script on Windows (again, selecting a node from the parameters), everything is fine.

          Code changed in jenkins
          User: imod
          Path:
          src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterValue.java
          http://jenkins-ci.org/commit/nodelabelparameter-plugin/81e2d255c9dab615eb21e9ec5ea969cf3243137b
          Log:
          JENKINS-15339 / JENKINS-24280 make sure node name is not empty

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterValue.java http://jenkins-ci.org/commit/nodelabelparameter-plugin/81e2d255c9dab615eb21e9ec5ea969cf3243137b Log: JENKINS-15339 / JENKINS-24280 make sure node name is not empty

          I am reproducing the issue again in a recent version:

          • Jenkins 2.134
          • Node and Label Parameter plugin 1.7.2
          • Environment Injector Plugin 2.1.6

          Sebastien Matte added a comment - I am reproducing the issue again in a recent version: Jenkins 2.134 Node and Label Parameter plugin 1.7.2 Environment Injector Plugin 2.1.6

          Rui Pedro Caldeira added a comment - - edited

          Hello all, I have a new reproduction with:

          • Jenkins 2.164.2 (Linux Master)
          • Node and Label Parameter plugin 1.7.2
          • I don't have the Environment Injector Plugin

          And detected only when the Windows slave is running as a service. Not when it is running manually with a normal user

          Thank you all

          Rui Pedro Caldeira added a comment - - edited Hello all, I have a new reproduction with: Jenkins 2.164.2 (Linux Master) Node and Label Parameter plugin 1.7.2 I don't have the Environment Injector Plugin And detected only when the Windows slave is running as a service. Not when it is running manually with a normal user Thank you all

          I can confirm this bug too.  I am looking forward to the update.

          Christian Häussler added a comment - I can confirm this bug too.  I am looking forward to the update.

          Mark Waite added a comment -

          I can't duplicate this problem with Jenkins 2.277.1, node label parameter plugin 1.8.0, and Windows agents started from a batch file (not a service) or from an ssh call to the Windows OpenSSH service. I don't have any Windows agents that run as a service but are not using ssh. Can others confirm that it truly is specific to Windows agents running as a service and not using the Windows OpenSSH service to start the agent?

          Mark Waite added a comment - I can't duplicate this problem with Jenkins 2.277.1, node label parameter plugin 1.8.0, and Windows agents started from a batch file (not a service) or from an ssh call to the Windows OpenSSH service. I don't have any Windows agents that run as a service but are not using ssh. Can others confirm that it truly is specific to Windows agents running as a service and not using the Windows OpenSSH service to start the agent?

            domi Dominik Bartholdi
            glenncoombs Glenn Coombs
            Votes:
            6 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: