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

'chcp' is not recognized as an internal or external command, operable program or batch file.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • msbuild-plugin
    • Win7 in Dutch, Jenkins v2.46, MSBuild Plugin v1.27

      After upgrading from MSBuild Plugin v1.26 to v1.27, all builds using MSBuild plugin failed with:

      'chcp' is not recognized as an internal or external command, operable program or batch file.

      This seems to be related to case: JENKINS-24132.

      As a work-around, i (manually) reverted to MSBuild Plugin v1.26.

      Running chcp on the same machine works, running chcp via the Jenkins script console yields the same error.
      Running chcp.com via the Jenkins script console works.

      Can we please change chcp to chcp.com?

          [JENKINS-42284] 'chcp' is not recognized as an internal or external command, operable program or batch file.

          Roel van Nuland created issue -
          Roel van Nuland made changes -
          Description Original: After upgrading from MSBuild Plugin v1.26 to v1.27, all builds using MSBuild plugin failed with:

          {code:none}'chcp' is not recognized as an internal or external command, operable program or batch file.{code}

          This seems to be released with case: JENKINS-24132.

          As a work-around, i (manually) reverted to MSBuild Plugin v1.26.

          Running {{chcp}} on the same machine works, running {{chcp}} via the Jenkins script console yields the same error.
          Running {{chcp.com}} via the Jenkins script console works.

          Can we please change {{chcp}} to {{chcp.com}}?
          New: After upgrading from MSBuild Plugin v1.26 to v1.27, all builds using MSBuild plugin failed with:

          {code:none}'chcp' is not recognized as an internal or external command, operable program or batch file.{code}

          This seems to be related to case: JENKINS-24132.

          As a work-around, i (manually) reverted to MSBuild Plugin v1.26.

          Running {{chcp}} on the same machine works, running {{chcp}} via the Jenkins script console yields the same error.
          Running {{chcp.com}} via the Jenkins script console works.

          Can we please change {{chcp}} to {{chcp.com}}?

          Hello,

          It is pretty strange indeed. Could you please provide the following informations :

          • Is Jenkins running on a x64 system ?
          • Could you run "where chcp" and "where chcp.com" out of Jenkins and inside of Jenkins (using Jenkins script console) ?
          • Could you run "echo %PATH%" inside and outside Jenkins ?

          Thanks
          Regards
          Lionel

          Lionel Cabasson added a comment - Hello, It is pretty strange indeed. Could you please provide the following informations : Is Jenkins running on a x64 system ? Could you run "where chcp" and "where chcp.com" out of Jenkins and inside of Jenkins (using Jenkins script console) ? Could you run "echo %PATH%" inside and outside Jenkins ? Thanks Regards Lionel

          Hi Lionel,

          Yes, the slave runs on a x64 machine (as does the server).
          It is Windows 7 64bit, running 64bit java:

          java version "1.8.0_121"
          Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
          Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
          

          The slave runs jenkins as a service, and jenkins-slave.exe also seems to be 64bit.

          On the slave (directly from the prompt):

          • "where chcp" -> "C:\Windows\System32\chcp.com"
          • "where chcp.com" -> "C:\Windows\System32\chcp.com"
          • "echo %path%" -> "C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\"

          On the slave via script console:

          • "where chcp" -> "C:\Windows\System32\chcp.com"
          • "where chcp.com" -> "C:\Windows\System32\chcp.com"
          • "println System.getenv("PATH")" -> "C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\"

          I could not get "echo %path%" to work via script console.
          Please note that i removed some personal info from the path, but both where identical.

          I did some further testing, and "chcp" works after i copied "C:\Windows\System32\chcp.com" to "C:\Windows\System32\chcp.exe"

          Regards, Roel.

          Roel van Nuland added a comment - Hi Lionel, Yes, the slave runs on a x64 machine (as does the server). It is Windows 7 64bit, running 64bit java: java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) The slave runs jenkins as a service, and jenkins-slave.exe also seems to be 64bit. On the slave (directly from the prompt): "where chcp" -> "C:\Windows\System32\chcp.com" "where chcp.com" -> "C:\Windows\System32\chcp.com" "echo %path%" -> "C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\" On the slave via script console: "where chcp" -> "C:\Windows\System32\chcp.com" "where chcp.com" -> "C:\Windows\System32\chcp.com" "println System.getenv("PATH")" -> "C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\" I could not get "echo %path%" to work via script console. Please note that i removed some personal info from the path, but both where identical. I did some further testing, and "chcp" works after i copied "C:\Windows\System32\chcp.com" to "C:\Windows\System32\chcp. exe " Regards, Roel.

          Hi,
           
          Some more info:
          even after copying chcp.com to chcp.exe, the v1.27 plugin still produces the same error.

          I'm not running the Jenkins slave service as the default user (Local system) but as a dedicated User which is part of the Users group.
          (I did not yet fiddle with the rights of that user, just a standard new local Windows user).

          Might that have something to do with it?

          Regards, Roel.

          Roel van Nuland added a comment - Hi,   Some more info: even after copying chcp.com to chcp.exe , the v1.27 plugin still produces the same error. I'm not running the Jenkins slave service as the default user (Local system) but as a dedicated User which is part of the Users group. (I did not yet fiddle with the rights of that user, just a standard new local Windows user). Might that have something to do with it? Regards, Roel.

          Hello,

          Maybe this user does not have access right to chcp or the user PATH environment variable does not contain its parent forlder.

          Could you try running Jenkins with the Local system user for the sake of testing ?

          I wanted to wait a little bit to see if there was any other user who encountered the same issue but it seems you're the only one so it's probably an environment specific problem. By the way, I will think about adding an option not to run chcp so that one can disable it if any problem arise.

          Regards
          Lionel

          Lionel Cabasson added a comment - Hello, Maybe this user does not have access right to chcp or the user PATH environment variable does not contain its parent forlder. Could you try running Jenkins with the Local system user for the sake of testing ? I wanted to wait a little bit to see if there was any other user who encountered the same issue but it seems you're the only one so it's probably an environment specific problem. By the way, I will think about adding an option not to run chcp so that one can disable it if any problem arise. Regards Lionel

          Hi Lionel,

          I've changed the service to run as Local Service now, and it behaves exactly like it did when it ran as a separate user.
          I also tried with Local System by reinstalling the service, but this also behaves exactly like it did when it ran as a separate user.

          Adding the option to not run chcp would be greatly appreciated.

          Regards, Roel.

          Roel van Nuland added a comment - Hi Lionel, I've changed the service to run as Local Service now, and it behaves exactly like it did when it ran as a separate user. I also tried with Local System by reinstalling the service, but this also behaves exactly like it did when it ran as a separate user. Adding the option to not run chcp would be greatly appreciated. Regards, Roel.

          Shawn Baker added a comment -

          I'm having this exact problem.  Jenkins 2.46.1 LTS, MSBuild V1.27 on Windows Server 2012 R2 64-bit.  When I downgrade the MSBuild back to V1.26, the problem goes away.

          Shawn Baker added a comment - I'm having this exact problem.  Jenkins 2.46.1 LTS, MSBuild V1.27 on Windows Server 2012 R2 64-bit.  When I downgrade the MSBuild back to V1.26, the problem goes away.

          Hello Shawn,

          Thanks for your feedback, I will try to take some time to do a new release with the following features :

          • an error running chcp should be ignored and not prevent msbuild from running
          • the plugin should provide an option to disable the chcp command

          Regards
          Lionel

          Lionel Cabasson added a comment - Hello Shawn, Thanks for your feedback, I will try to take some time to do a new release with the following features : an error running chcp should be ignored and not prevent msbuild from running the plugin should provide an option to disable the chcp command Regards Lionel

          Ajit Surana added a comment -

          Is this problem resolved?
          I can see exact same problem given by Build a Visual Studio project or solution using MSBuild Jenkins plugin in the slave job.

          Command:

          [Klocwork_CSharp_Project_Builder] $ cmd.exe /C " chcp 1252 && "C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe" /p:Configuration=Release %WORKSPACE%\KWCSharpProjectBuilder.sln " && exit %%ERRORLEVEL%%
          

          Error:

          'chcp' is not recognized as an internal or external command,
          

          Ajit Surana added a comment - Is this problem resolved? I can see exact same problem given by Build a Visual Studio project or solution using MSBuild Jenkins plugin in the slave job. Command: [Klocwork_CSharp_Project_Builder] $ cmd.exe /C " chcp 1252 && "C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe" /p:Configuration=Release %WORKSPACE%\KWCSharpProjectBuilder.sln " && exit %%ERRORLEVEL%% Error: 'chcp' is not recognized as an internal or external command,

            marshall777 Lionel Cabasson
            kompjoefriek Roel van Nuland
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: