Went through a very irritating "feature" of Jenkins in Windows, the fact that it runs as the default system user.
From there you have to options:
- Change the system user to have the dependencies you need, or
- Use a regular account
I went with the later.
The symptom is that commands executed in the Build - Execute Windows batch command step will not be able to find executables, despite the fact that they are defined in %PATH%.
A good way to diagnose is to check that you really have the %PATH% properly set and identify who's running the command. Use these two lines:
echo %PATH%
echo %USERDOMAIN%\%USERNAME%
To solve set the properties in the Jenkins service to use the user you wan and that should marry things just nicely. There are drawbacks in using user accounts like that but it's much easier and have the expected behaviour.
Thanks, this saved my ass, after one day of desperation. I don't know why the jenkins docs don't mentioned to change the user to something else SYSTEM.
ReplyDeleteYou saved my life dude :)
ReplyDeleteWOW, thanks... spent many hours trying to get ruby and python working with jenkins windows... only found the solution HERE.
ReplyDeleteCan you let me know is there a way to run Jenkins tasks using Windows command line. I want to run jenkins remotely using Bamboo. Because I have both servers in our system. If I can run jenkins using command line in windows, then i can add it to bamboo script and run jenkins when i want.
ReplyDeleteHow about invoking it via HTTP?
DeleteThanks, I spent a lot of time on this problem before finding this.
ReplyDeletethanks a lot for sharing this information,
ReplyDeleteThank you for sharing your findings and solutions! I spent many hours (as it looks many others have, too!) troubleshooting this issue! It all works great now!
ReplyDeleteTHANK YOU!
ReplyDeleteHi, thanks for this post :)
ReplyDeleteDo you know how to change the user when running inside Tomcat? I did try to change the user in tomcat "configure..." but it had no effect
No worries :) From memory, you should be able to change the users as needed in $catalina_home/conf/tomcat-users.xml
DeleteThank you very much!! I spent a day trying to figure out this. Thanks!!
ReplyDeleteWhat she said, what he said: ditto. Shall we add the addendum to Jenkins doc? Windows configuration?
ReplyDeleteNeal
Thanks man, you saved me couple of hours.
ReplyDeleteThank you. Your post is super helpful
ReplyDeleteSaved my life . Thank u
ReplyDelete