i am getting below error while configuring the job in jenkins first time

3,426 views
Skip to first unread message

naveen kumar

unread,
Feb 16, 2018, 3:24:46 PM2/16/18
to Jenkins Users
Console Output Started by user admin Building on master in workspace C:\Jenkins\JenkinsHome\workspace\HelloWorld Cloning the remote Git repository Cloning repository https://github.com/naveenaws2018/HelloWorld.git > git.exe init C:\Jenkins\JenkinsHome\workspace\HelloWorld # timeout=10 ERROR: Error cloning remote repo 'origin' Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "C:\Jenkins\JenkinsHome\workspace\HelloWorld"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:249) at hudson.Proc$LocalProc.<init>(Proc.java:218) at hudson.Launcher$LocalLauncher.launch(Launcher.java:930) at hudson.Launcher$ProcStarter.start(Launcher.java:450) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1992) ... 16 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 22 more ERROR: Error cloning remote repo 'origin' Finished: FAILURE Please help

Mark Waite

unread,
Feb 16, 2018, 3:28:49 PM2/16/18
to Jenkins Users


On Friday, February 16, 2018 at 1:24:46 PM UTC-7, naveen kumar wrote:
Console Output Started by user admin Building on master in workspace C:\Jenkins\JenkinsHome\workspace\HelloWorld Cloning the remote Git repository Cloning repository https://github.com/naveenaws2018/HelloWorld.git > git.exe init C:\Jenkins\JenkinsHome\workspace\HelloWorld # timeout=10 ERROR: Error cloning remote repo 'origin' Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "C:\Jenkins\JenkinsHome\workspace\HelloWorld"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:249) at hudson.Proc$LocalProc.<init>(Proc.java:218) at hudson.Launcher$LocalLauncher.launch(Launcher.java:930) at hudson.Launcher$ProcStarter.start(Launcher.java:450) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1992) ... 16 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified

The program "git.exe" is not configured in the PATH for the Jenkins process on the agent running that command.

There are several ways to fix that.  You can add C:\Program Files\Git\bin to the PATH on that machine before starting the agent, then start the agent.  You can define a tool which installs the Windows "portable git" on each agent automatically.  You can configure the agent in Jenkins by adding a "tool location" which provides the absolute path to the git executable.  You can enable JGit as a git implementation, then configure your job to use JGit instead of using command line git.

Mark Waite

naveen kumar

unread,
Feb 16, 2018, 3:41:20 PM2/16/18
to Jenkins Users
Added the path and launched agent again but no luck 
Inked2018-02-17 02_06_47-Administrator_ Command Prompt_LI.jpg

Mark Waite

unread,
Feb 16, 2018, 4:04:52 PM2/16/18
to jenkins...@googlegroups.com
On Fri, Feb 16, 2018 at 1:41 PM naveen kumar <navin...@gmail.com> wrote:
Added the path and launched agent again but no luck 


Check that the system information page for that agent shows that the PATH setting was actually applied to that agent.  That message indicates that git.exe is not being found in the PATH.

You might also adjust the configuration of the global git tool (in the Global Tools Configuration) to use "git" instead of "git.exe" as the git program.  The "exe" suffix is not needed as far as I know.

Mark Waite
 

On Saturday, February 17, 2018 at 1:54:46 AM UTC+5:30, naveen kumar wrote:
Console Output Started by user admin Building on master in workspace C:\Jenkins\JenkinsHome\workspace\HelloWorld Cloning the remote Git repository Cloning repository https://github.com/naveenaws2018/HelloWorld.git > git.exe init C:\Jenkins\JenkinsHome\workspace\HelloWorld # timeout=10 ERROR: Error cloning remote repo 'origin' Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "C:\Jenkins\JenkinsHome\workspace\HelloWorld"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:249) at hudson.Proc$LocalProc.<init>(Proc.java:218) at hudson.Launcher$LocalLauncher.launch(Launcher.java:930) at hudson.Launcher$ProcStarter.start(Launcher.java:450) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1992) ... 16 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 22 more ERROR: Error cloning remote repo 'origin' Finished: FAILURE Please help

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c01ede0a-6edc-456d-b435-e16a3ec39d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

naveen kumar

unread,
Feb 16, 2018, 9:23:27 PM2/16/18
to Jenkins Users
Thanks Mark.
After adjust the configuration of the global git tool (in the Global Tools Configuration) it worked fine 
Reply all
Reply to author
Forward
0 new messages