This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      I started to convert a Freestyle job to a declarative Pipeline job today, and found that most of the time it was failing with the following error: 'cmd' is not recognized as an internal or external command, operable program or batch file.

      After some investigation I realized that several of my build agents have the PATH variable overridden in the node configuration, i.e.

      PATH=${PATH};c:\some\additional\path
      

      With a Freestyle job,

      ${PATH}
      

      is expanded correctly, but with the Pipeline job it appears not to be; adding an echo env.PATH prior to my bat step echoes an unexpanded path. It doesn't look like there's another way to get at the run environment like w/ a freestyle job, so I am not sure how else to check for sure that this is what is happening, but it seems likely.

      I see the same behavior if I try PATH=%PATH%;.., which doesn't work on Freestyle jobs either, so I know that's not the problem..

      If we clear the PATH override in the build agent node properties, it works fine. We're looking at whether we really need to do this override on all our build agents, but this should work just like it does with a freestyle job.

        1. nodeproperties.PNG
          14 kB
          Will Saxon
        2. result.PNG
          12 kB
          Will Saxon
        3. snippet.PNG
          15 kB
          Will Saxon

            Assignee:
            Unassigned
            Reporter:
            Will Saxon
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: