Error when trying to configure Jenkins: hudson.plugins.git.GitException: Error performing command: git rev-parse --is-inside-work-tree

3,045 views
Skip to first unread message

Oana Rusu

unread,
May 9, 2014, 11:07:26 AM5/9/14
to jenkins...@googlegroups.com
Hi all,

I have a Windows server running Jenkins and on that I configured a slave for Mac, as I want to run an iOS project on it.
My slave is now connected to the Windows server. 
I tried to add a new job that connects to my .git repository, but I get the followings errors. Can anyone help me figuring this out?

Started by user anonymous
Building remotely on Fusion_Automation_iOS_Slave in workspace /Users/Shared/Jenkins/workspace/Fusion_iOS_UAT
ERROR: Workspace has a .git repository, but it appears to be corrupt.
hudson.plugins.git.GitException: Error performing command: git rev-parse --is-inside-work-tree
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1190)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1160)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1156)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:972)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:982)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.hasGitRepo(CliGitAPIImpl.java:136)
	at hudson.plugins.git.GitAPI.hasGitRepo(GitAPI.java:186)
	at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:328)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at hudson.remoting.Engine$1$1.run(Engine.java:63)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "/Users/Shared/Jenkins/workspace/Fusion_iOS_UAT"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
	at hudson.Launcher$ProcStarter.start(Launcher.java:353)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1179)
	... 21 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
	at java.lang.ProcessImpl.start(ProcessImpl.java:130)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
	... 26 more
Cloning the remote Git repository
Cloning repository http://10.16.100.243:85/FusionIOS.git
Fetching upstream changes from http://10.16.100.243:85/FusionIOS.git
using .gitcredentials to set credentials
Could not remove the credential section from the git configuration
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Error performing command: git config --local credential.helper store --file=/var/folders/71/yw1x3m416515sdjly629gsf40000gp/T/git1566527670464557635.credentials
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1190)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1160)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1156)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1152)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1049)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:88)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:219)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:370)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:328)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at hudson.remoting.Engine$1$1.run(Engine.java:63)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "/Users/Shared/Jenkins/workspace/Fusion_iOS_UAT"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
	at hudson.Proc$LocalProc.<init>(Proc.java:244)
	at hudson.Proc$LocalProc.<init>(Proc.java:216)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:773)
	at hudson.Launcher$ProcStarter.start(Launcher.java:353)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1179)
	... 18 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
	at java.lang.ProcessImpl.start(ProcessImpl.java:130)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
	... 23 more

Mark Waite

unread,
May 9, 2014, 11:24:48 AM5/9/14
to jenkins...@googlegroups.com
You either need to install command line git (msysgit) on your windows machine, or add JGit to the global Jenkins configuration and use JGit as the implementation instead of git.

Mark Waite


--
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.
For more options, visit https://groups.google.com/d/optout.



--
Thanks!
Mark Waite

Mark Waite

unread,
May 9, 2014, 11:26:59 AM5/9/14
to jenkins...@googlegroups.com
Sorry, missed the reading of your log file.  Your MacOS slave needs to have the location of its "git" program configured in the node configuration.  Currently, Jenkins thinks that the correct git program for your MacOS slave is named "git.exe".  I suspect that the correct git program for your MacOS slave is named "git" rather than "git.exe".
--
Thanks!
Mark Waite

Curtis Kline

unread,
May 9, 2014, 7:51:42 PM5/9/14
to jenkins...@googlegroups.com
Oana, on my OS-X slaves Git is located in /usr/bin/git. /usr/bin is in the path (run 'echo $PATH' in a terminal window) so I don't have to enter a location in the slave config. But if you needed to, this is where you do that:


That config page can be found at http://jenkins-server/computer/nodename/configure

Curtis

Parteek Kumar

unread,
Aug 7, 2014, 5:45:36 PM8/7/14
to jenkins...@googlegroups.com
Hi Curtis,

Could you please explain about the script to specify the git tool, I dont want to mention git tool location under node properties for slave.

Many thanks.

Parteek

Mark Waite

unread,
Aug 7, 2014, 5:56:16 PM8/7/14
to jenkins...@googlegroups.com

You probably have the Jenkins master node configured to specify git as git.exe.  remove the exe from the end of that on the master node and the slaves will follow.

Mark Waite

Parteek Kumar

unread,
Aug 7, 2014, 6:37:13 PM8/7/14
to jenkins...@googlegroups.com
Thanks Mark..it worked....

Parteek Kumar

unread,
Aug 7, 2014, 6:42:20 PM8/7/14
to jenkins...@googlegroups.com

Hi Mark,

Also please suggest same thing for maven and java, what is work around to specify the both these tools if I dont want to enter manually in Slave node properties.

Thanks,

Parteek
Reply all
Reply to author
Forward
0 new messages