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

Locking resource by label breaks windows batch execution

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins ver. 2.63, lockable-resources-plugin 2.0

      I created a new freestyle job that I configured to lock a resource by label and execute a windows batch.

      I get following error:

      [lockable-resources] acquired lock on [MSbuild_Robotic]
      [EnvInject] - Loading node environment variables.
       Building remotely on windowsslave (ctc codesonar windows) in workspace e:\jenkins\workspace\work_testjob
      [work_testjob] $ cmd /c call C:\Users\SAFETY~1\AppData\Local\Temp\hudson8046177881644065079.bat
       The parameter is incorrect
        FATAL: command execution failed
       java.io.IOException: CreateProcess error=87, The parameter is incorrect
        at java.lang.ProcessImpl.create(Native Method)
       at java.lang.ProcessImpl.<init>(Unknown Source)
        ...<snip>

       

      This does not happen if I configure it to lock the resource by name instead of label.

      Maybe it is noteable that in this case I configured the resource in the way that it's name is identical to it's label.

          [JENKINS-45128] Locking resource by label breaks windows batch execution

          Roman Zwi added a comment -

          retest with Jenkins V2.63 - still happens

          Roman Zwi added a comment - retest with Jenkins V2.63 - still happens

          Roman Zwi added a comment -

          I had another effect of this issue: checking out the project from git failed on windows slave.
          console output:

          ERROR: Error cloning remote repo 'origin'
          hudson.plugins.git.GitException: Could not init e:\jenkins\workspace\MyProject
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:717)
          <... snip ...>
          Caused by: hudson.plugins.git.GitException: Error performing command: git init e:\jenkins\workspace\SafeDESIGNER_UnitTest\Source\SafeDESIGNER
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1931)
          <... snip ...>
          Caused by: java.io.IOException: Cannot run program "git" (in directory "e:\jenkins\workspace\SafeDESIGNER_UnitTest\Source\SafeDESIGNER"): CreateProcess error=87, The parameter is incorrect
          at java.lang.ProcessBuilder.start(Unknown Source)
          <... snip ...>
          Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
          at java.lang.ProcessImpl.create(Native Method)
          <... snip ...>
          ERROR: Error cloning remote repo 'origin'

           

          Roman Zwi added a comment - I had another effect of this issue: checking out the project from git failed on windows slave. console output: ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not init e:\jenkins\workspace\MyProject at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:717) <... snip ...> Caused by: hudson.plugins.git.GitException: Error performing command: git init e:\jenkins\workspace\SafeDESIGNER_UnitTest\Source\SafeDESIGNER at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1931) <... snip ...> Caused by: java.io.IOException: Cannot run program "git" (in directory "e:\jenkins\workspace\SafeDESIGNER_UnitTest\Source\SafeDESIGNER"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(Unknown Source) <... snip ...> Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect at java.lang.ProcessImpl.create(Native Method) <... snip ...> ERROR: Error cloning remote repo 'origin'  

          Roman Zwi added a comment -

          The seems to appear as soon as I do a config change in an old job.

          old config that worked fine:

            <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@1.11.1">
                <labelName>MSbuild</labelName>
            </org.jenkins.plugins.lockableresources.RequiredResourcesProperty>

          new config that fails (note that I didn't do any change to one of those parameters - the config was changed automatically due to an unrelated change in this job's config):

            <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@2.0">
              <resourceNames></resourceNames>
              <resourceNamesVar></resourceNamesVar>
              <resourceNumber></resourceNumber>
              <labelName>MSbuild</labelName>
            </org.jenkins.plugins.lockableresources.RequiredResourcesProperty>

          It was quite hard to find, because of course I thought the failure was caused by the other change I did to this job...

          Roman Zwi added a comment - The seems to appear as soon as I do a config change in an old job. old config that worked fine:   <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@1.11.1">       <labelName>MSbuild</labelName>   </org.jenkins.plugins.lockableresources.RequiredResourcesProperty> new config that fails (note that I didn't do any change to one of those parameters - the config was changed automatically due to an unrelated change in this job's config):   <org.jenkins.plugins.lockableresources.RequiredResourcesProperty plugin="lockable-resources@2.0">     <resourceNames></resourceNames>     <resourceNamesVar></resourceNamesVar>     <resourceNumber></resourceNumber>     <labelName>MSbuild</labelName>   </org.jenkins.plugins.lockableresources.RequiredResourcesProperty> It was quite hard to find, because of course I thought the failure was caused by the other change I did to this job...

          Same issue with lockable resources version 2.1

          Patrick Visser added a comment - Same issue with lockable resources version 2.1

          Same issue here: lockable resources version 2.1

          Marie-Helene Touchette added a comment - Same issue here: lockable resources version 2.1

          J P added a comment -

          Exactly the same issue. Anybody found a way to fix this somehow?

           

          I even think this is a major issue as it breaks our build system. The only work around for me was to deactivate the plugin and change the build system in bad ways

          J P added a comment - Exactly the same issue. Anybody found a way to fix this somehow?   I even think this is a major issue as it breaks our build system. The only work around for me was to deactivate the plugin and change the build system in bad ways

            Unassigned Unassigned
            romanz Roman Zwi
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: