Error while executing git clone --branch=master --no-checkout

663 views
Skip to first unread message

Anuja Kadloor

unread,
Jun 1, 2016, 3:10:12 AM6/1/16
to go-cd
Hi,

I am a newbie to Go-CD and I'm trying to integrate my mavenized project with Go-CD.
I have downloaded Go Server and Go Agent and have set up both on my local system (Windows 7).

I'm able to successfully create a pipeline, create jobs and assign the agent and environment.
When I execute my job, I get following error in console output:-

12:18:08.494 [go] Job Started: 2016-06-01 12:18:08 IST

12:18:08.494 [go] Start to prepare XMLI_Testing/5/XMLI_Testing/1/XMLI_Testing on 01HW346482 [C:\Softwares\GOCD\Go Agent]

12:18:08.507 [go] Start to update materials.

12:18:08.507 [go] Start updating XMLI_Testing at revision 1b00a1f965c5b64d54c1fcef5db44bfa4c8d9a62 from http://user@xyz/stash/scm/someproj/xmli_testing.git

12:18:08.511 Error while executing [git clone --branch=master --no-checkout http://user@xyz/stash/scm/someproj/xmli_testing.git "C:\Softwares\GOCD\Go Agent\pipelines\XMLI_Testing\XMLI_Testing"] 

 Make sure this command can execute manually.

12:18:08.590 [go] Job completed XMLI_Testing/5/XMLI_Testing/1/XMLI_Testing on 01HW346482 [C:\Softwares\GOCD\Go Agent]


Following is the content of agent.log:-
2016-06-01 12:18:08,511 [loopThread] ERROR thoughtworks.go.util.ProcessManager:111 - [Command Line] Agent's Environment Variables: {USERPROFILE=C:\Windows\system32\config\systemprofile, GO_SERVER_JAVA_HOME=C:\Softwares\GOCD\Go Server\jre, JAVA_HOME=C:\Softwares\GOCD\Go Agent\jre, SystemDrive=C:, GO_SERVER=01HW346482, M2=C:\Softwares\apache-maven-3.3.1\bin, DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection, Path=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Softwares\apache-maven-3.3.1\bin;C:\Program Files\Java\jdk1.8.0_91;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\, CRUISE_SERVER_DIR=C:\Softwares\GOCD\Go Server, PROCESSOR_REVISION=170a, WRAPPER_BITS=32, USERDOMAIN=EIS, ALLUSERSPROFILE=C:\ProgramData, WRAPPER_HOST_NAME=01HW346482, WRAPPER_WORKING_DIR=C:\Softwares\GOCD\Go Agent, GO_AGENT_DIR=C:\Softwares\GOCD\Go Agent, AGENT_STARTUP_ARGS=-Xms128m -Xmx256m -Dno_debugging -Dno_gc_logging "-DJAVA_SYS_MON_TEMP_DIR=C:\Softwares\GOCD\Go Agent\tmp", TMP=C:\Windows\system32\config\systemprofile\AppData\Local\Temp, M2_HOME=C:\Softwares\apache-maven-3.3.1, CommonProgramFiles=C:\Program Files (x86)\Common Files, PROCESSOR_LEVEL=6, LOCALAPPDATA=C:\Windows\system32\config\systemprofile\AppData\Local, COMPUTERNAME=01HW346482, GC_LOG=-Dno_gc_logging, SystemRoot=C:\Windows, USERNAME=SYSTEM, GO_AGENT_JAVA_HOME=C:\Softwares\GOCD\Go Agent\jre, APPDATA=C:\Windows\system32\config\systemprofile\AppData\Roaming, ProgramData=C:\ProgramData, WRAPPER_FILE_SEPARATOR=\, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC, WRAPPER_OS=windows, ProgramFiles(x86)=C:\Program Files (x86), WRAPPER_BIN_DIR=C:\Softwares\GOCD\Go Agent, TEMP=C:\Windows\system32\config\systemprofile\AppData\Local\Temp, ProgramFiles=C:\Program Files (x86), =C:=C:\Softwares\GOCD\Go Agent, UATDATA=C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77, ProgramW6432=C:\Program Files, VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection, PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel, JVM_DEBUG=-Dno_debugging, JVM_DEBUG_PORT=5006, GC_LOG_LOCATION="C:\Softwares\GOCD\Go Agent\go-agent-gc.log", PROCESSOR_ARCHITECTURE=AMD64, FP_NO_HOST_CHECK=NO, OS=Windows_NT, PROCESSOR_ARCHITEW6432=AMD64, WRAPPER_ARCH=x86, CommonProgramW6432=C:\Program Files\Common Files, windir=C:\Windows, NUMBER_OF_PROCESSORS=2, PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\, PUBLIC=C:\Users\Public, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, ComSpec=C:\Windows\system32\cmd.exe, WRAPPER_PATH_SEPARATOR=;}
2016-06-01 12:18:08,511 [loopThread] ERROR thoughtworks.go.work.DefaultGoPublisher:136 - Error while executing [git clone --branch=master --no-checkout http://user@xyz/stash/scm/someproj/xmli_testing.git "C:\Softwares\GOCD\Go "C:\Softwares\GOCD\Go Agent\pipelines\XMLI_Testing\XMLI_Testing"] 
 Make sure this command can execute manually.
java.lang.RuntimeException: Error while executing [git clone --branch=master --no-checkout http://user@xyz/stash/scm/someproj/xmli_testing.git "C:\Softwares\GOCD\Go "C:\Softwares\GOCD\Go Agent\pipelines\XMLI_Testing\XMLI_Testing"] 
 Make sure this command can execute manually.
at com.thoughtworks.go.util.ExceptionUtils.bomb(ExceptionUtils.java:36)
at com.thoughtworks.go.config.materials.git.GitMaterial.updateTo(GitMaterial.java:152)
at com.thoughtworks.go.domain.MaterialRevision.updateTo(MaterialRevision.java:151)
at com.thoughtworks.go.domain.materials.AbstractMaterialAgent.prepare(AbstractMaterialAgent.java:41)
at com.thoughtworks.go.remote.work.BuildWork.prepareJob(BuildWork.java:189)
at com.thoughtworks.go.remote.work.BuildWork.build(BuildWork.java:137)
at com.thoughtworks.go.remote.work.BuildWork.doWork(BuildWork.java:92)
at com.thoughtworks.go.agent.JobRunner.run(JobRunner.java:60)
at com.thoughtworks.go.agent.AgentController.retrieveWork(AgentController.java:210)
at com.thoughtworks.go.agent.AgentController.rpcLoop(AgentController.java:164)
at com.thoughtworks.go.agent.AgentController.loop(AgentController.java:154)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.support.MethodInvokingRunnable.run(MethodInvokingRunnable.java:65)
at org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:70)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: com.thoughtworks.go.util.command.CommandLineException: Error while executing [git clone --branch=master --no-checkout http://user@xyz/stash/scm/someproj/xmli_testing.git "C:\Softwares\GOCD\Go "C:\Softwares\GOCD\Go Agent\pipelines\XMLI_Testing\XMLI_Testing"] 
 Make sure this command can execute manually.
at com.thoughtworks.go.util.ProcessManager.startProcess(ProcessManager.java:112)
at com.thoughtworks.go.util.ProcessManager.createProcess(ProcessManager.java:64)
at com.thoughtworks.go.util.command.CommandLine.createProcess(CommandLine.java:367)
at com.thoughtworks.go.util.command.CommandLine.execute(CommandLine.java:360)
at com.thoughtworks.go.util.command.CommandLine.run(CommandLine.java:514)
at com.thoughtworks.go.domain.materials.SCMCommand.run(SCMCommand.java:34)
at com.thoughtworks.go.domain.materials.git.GitCommand.cloneFrom(GitCommand.java:72)
at com.thoughtworks.go.config.materials.git.GitMaterial.git(GitMaterial.java:235)
at com.thoughtworks.go.config.materials.git.GitMaterial.updateTo(GitMaterial.java:146)
... 17 more
Caused by: java.io.IOException: Cannot run program "git": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at com.thoughtworks.go.util.ProcessManager.startProcess(ProcessManager.java:105)
... 25 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)
... 27 more
2016-06-01 12:18:08,511 [loopThread] INFO  thoughtworks.go.work.DefaultGoPublisher:106 - Agent [01HW346482, 172.24.151.122, 026b6c5e-6579-4af6-adf7-8a2e7b8201b9] is reporting build result [Failed] to Go Server for Build [XMLI_Testing/5/XMLI_Testing/1/XMLI_Testing/66]
2016-06-01 12:18:08,590 [loopThread] INFO  thoughtworks.go.work.DefaultGoPublisher:89 - Stopping Transmission for Build [XMLI_Testing/5/XMLI_Testing/1/XMLI_Testing/66]

Please Note:- I am able to clone the repository manually.
Any help would be highly appreciated.

Thanks & Regards,
Anuja

Zabil C M

unread,
Jun 1, 2016, 4:09:36 AM6/1/16
to go-cd
Looks like the agent is not able to locate "git" on it's %PATH% 
If git was installed after the installing or running the agent can you try restarting (the agent) and running the job again?


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anuja Kadloor

unread,
Jun 1, 2016, 4:58:04 AM6/1/16
to go-cd
Hi Zabil,

Thanks for your response.
Git was already installed on my system. 

Any other help would be appreciated. 
Have been stuck on this since yesterday.

Thanks,
Anuja

Aravind SV

unread,
Jun 1, 2016, 9:13:14 AM6/1/16
to go...@googlegroups.com
This is the PATH of the agent, according to the logs: Path=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Softwares\apache-maven-3.3.1\bin;C:\Program Files\Java\jdk1.8.0_91;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\

Where is git installed in your PATH?

Also, this page might help.

If you're sure that git is installed and an agent restart does not help, check if the PATH variable which git is mentioned in is not "User environment variable". Since the Go Agent runs as a system service, it'll need to be in "System environment variables" on Windows.

Anuja Kadloor

unread,
Jun 1, 2016, 10:38:07 AM6/1/16
to go-cd
Hi Aravind,

Issue is resolved now.
As you correctly pointed out, git was not in my PATH.
Installed it again and set it in my PATH and now I'm able to clone the repository!

Thanks for the prompt reply!

Anuja
Reply all
Reply to author
Forward
0 new messages