Title: Message Title
Will Saxon created an issue
Jenkins / JENKINS-41998
'bat' step fails if configured agent overrides system path
Issue Type:
Bug
Assignee:
Unassigned
Attachments:
nodeproperties.PNG, result.PNG, snippet.PNG
Components:
pipeline
Created:
2017/Feb/13 11:39 PM
Environment:
Windows build agent using DCOM method, Java 1.7/1.8, Jenkins 2.32.3
Priority:
Minor
Reporter:
Will Saxon
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.