hudson.plugins.git.GitException: Could not clone

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I want the Jenkins master to build a small project on a slave. Slave and Master run Suse Linux. The same user (hans) which runs Jenkins is available on both machines and has rw permissions on the slave's remote working directory (/var/jenkins). The slave agent is launched on the slave ('ttvm3'). Building the project locally works. When I configure the project to be build on the slave, it fails. The console output on the master is: {quote} Started by user anonymous Building on master in workspace /home/hans/.jenkins/jobs/testproject/workspace Checkout:workspace / /home/hans/.jenkins/jobs/testproject/workspace - hudson.remoting.LocalChannel@11b1e39 Using strategy: Default Last Built Revision: Revision 97957e558fed7d0b116950e09dec1c248d1d0b54 (origin/HEAD, origin/master) Checkout:workspace / /home/hans/.jenkins/jobs/testproject/workspace - hudson.remoting.LocalChannel@11b1e39 Fetching changes from 1 remote Git repository Fetching upstream changes from <<blablabla>> Commencing build of Revision 69e242182e55e57b56c836a9c3a34f0232e5d56c (origin/master) Checking out Revision 69e242182e55e57b56c836a9c3a34f0232e5d56c (origin/master) Triggering ttvm3 ttvm3 completed with result FAILURE Finished: FAILURE {quote} The output on the slave for this build is: {quote} Started by upstream project "testproject" build number 29 Building remotely on ttvm3 in workspace /ttvm3 java.io.IOException: Failed to mkdirs: /ttvm3 at hudson.FilePath.mkdirs(FilePath.java:847) at hudson.model.AbstractProject.checkout(AbstractProject.java:1193) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465) at hudson.model.Run.run(Run.java:1409) at hudson.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Finished: FAILURE {quote} It seems as if Jenkins wants to create a directory called "ttvm3" (which is the name of the slave) in the root directory of the slave. When I (just for the fun of it) create the directory /ttvm3 on the slave and build the project again, the output for this build on the slave is: {quote} Started by upstream project "testproject" build number 30 Building remotely on ttvm3 in workspace /ttvm3 Checkout:ttvm3 / /ttvm3 - hudson.remoting.Channel@c4931d:ttvm3 Using strategy: Default Checkout:ttvm3 / /ttvm3 - hudson.remoting.LocalChannel@146c0f Cloning the remote Git repository Cloning repository origin ERROR: Failed to clean the workspace java.io.IOException: Unable to delete /ttvm3 at hudson.Util.deleteFile(Util.java:237) at hudson.Util.deleteRecursive(Util.java:287) at hudson.FilePath$9.invoke(FilePath.java:856) at hudson.FilePath$9.invoke(FilePath.java:854) at hudson.FilePath.act(FilePath.java:788) at hudson.FilePath.act(FilePath.java:770) at hudson.FilePath.deleteRecursive(FilePath.java:854) at hudson.plugins.git.GitAPI.clone(GitAPI.java:205) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1027) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2099) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) ERROR: Error cloning remote repo 'origin' : Failed to delete workspace ERROR: Cause: Unable to delete /ttvm3 Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1042) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2099) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) {quote}
    via by tasat bar,
  • I want the Jenkins master to build a small project on a slave. Slave and Master run Suse Linux. The same user (hans) which runs Jenkins is available on both machines and has rw permissions on the slave's remote working directory (/var/jenkins). The slave agent is launched on the slave ('ttvm3'). Building the project locally works. When I configure the project to be build on the slave, it fails. The console output on the master is: {quote} Started by user anonymous Building on master in workspace /home/hans/.jenkins/jobs/testproject/workspace Checkout:workspace / /home/hans/.jenkins/jobs/testproject/workspace - hudson.remoting.LocalChannel@11b1e39 Using strategy: Default Last Built Revision: Revision 97957e558fed7d0b116950e09dec1c248d1d0b54 (origin/HEAD, origin/master) Checkout:workspace / /home/hans/.jenkins/jobs/testproject/workspace - hudson.remoting.LocalChannel@11b1e39 Fetching changes from 1 remote Git repository Fetching upstream changes from <<blablabla>> Commencing build of Revision 69e242182e55e57b56c836a9c3a34f0232e5d56c (origin/master) Checking out Revision 69e242182e55e57b56c836a9c3a34f0232e5d56c (origin/master) Triggering ttvm3 ttvm3 completed with result FAILURE Finished: FAILURE {quote} The output on the slave for this build is: {quote} Started by upstream project "testproject" build number 29 Building remotely on ttvm3 in workspace /ttvm3 java.io.IOException: Failed to mkdirs: /ttvm3 at hudson.FilePath.mkdirs(FilePath.java:847) at hudson.model.AbstractProject.checkout(AbstractProject.java:1193) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465) at hudson.model.Run.run(Run.java:1409) at hudson.matrix.MatrixRun.run(MatrixRun.java:146) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Finished: FAILURE {quote} It seems as if Jenkins wants to create a directory called "ttvm3" (which is the name of the slave) in the root directory of the slave. When I (just for the fun of it) create the directory /ttvm3 on the slave and build the project again, the output for this build on the slave is: {quote} Started by upstream project "testproject" build number 30 Building remotely on ttvm3 in workspace /ttvm3 Checkout:ttvm3 / /ttvm3 - hudson.remoting.Channel@c4931d:ttvm3 Using strategy: Default Checkout:ttvm3 / /ttvm3 - hudson.remoting.LocalChannel@146c0f Cloning the remote Git repository Cloning repository origin ERROR: Failed to clean the workspace java.io.IOException: Unable to delete /ttvm3 at hudson.Util.deleteFile(Util.java:237) at hudson.Util.deleteRecursive(Util.java:287) at hudson.FilePath$9.invoke(FilePath.java:856) at hudson.FilePath$9.invoke(FilePath.java:854) at hudson.FilePath.act(FilePath.java:788) at hudson.FilePath.act(FilePath.java:770) at hudson.FilePath.deleteRecursive(FilePath.java:854) at hudson.plugins.git.GitAPI.clone(GitAPI.java:205) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1027) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2099) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) ERROR: Error cloning remote repo 'origin' : Failed to delete workspace ERROR: Cause: Unable to delete /ttvm3 Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1042) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2099) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) {quote}
    via by tasat bar,
  • GIT issues with a cloned job
    via by Johannes Wienke,
  • When cloning on a slave machine the git command is failing with the following message. I can work-around the below error, if I run the clone command ("/usr/local/bin/git clone --progress -o origin git@ourserver.com:/testing.git /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm") as the Jenkins user on the slave machine before I run the build. In all cases the (fail or pass) the directory "/var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm" always exists and is writable by the Jenkins user when the build is done. {code:title=Error} Started by upstream project "Test" build number 20 Building remotely on 5VLLTR1-ubuntu-server-vm in workspace /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm Checkout:5VLLTR1-ubuntu-server-vm / /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm - hudson.remoting.Channel@16bd72d:5VLLTR1-ubuntu-server-vm Using strategy: Default Last Built Revision: Revision fbe7001a321737db2cc2b2b29e1ce80b05a7ad6b (origin/master) Cloning the remote Git repository Cloning repository origin ERROR: Error cloning remote repo 'origin' : Could not clone git@ourserver.com:/testing.git hudson.plugins.git.GitException: Could not clone git@ourserver.com:/testing.git at hudson.plugins.git.GitAPI.clone(GitAPI.java:251) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1122) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: hudson.plugins.git.GitException: Command "/usr/local/bin/git clone --progress -o origin git@ourserver.com:/testing.git /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm" returned status code 128: stdout: stderr: fatal: Could not get current working directory: No such file or directory at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:818) at hudson.plugins.git.GitAPI.access$000(GitAPI.java:39) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:247) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:227) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitAPI.clone(GitAPI.java:227) ... 12 more Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1134) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {code}
    via by Ryan Lovelett,
  • When cloning on a slave machine the git command is failing with the following message. I can work-around the below error, if I run the clone command ("/usr/local/bin/git clone --progress -o origin git@ourserver.com:/testing.git /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm") as the Jenkins user on the slave machine before I run the build. In all cases the (fail or pass) the directory "/var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm" always exists and is writable by the Jenkins user when the build is done. {code:title=Error} Started by upstream project "Test" build number 20 Building remotely on 5VLLTR1-ubuntu-server-vm in workspace /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm Checkout:5VLLTR1-ubuntu-server-vm / /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm - hudson.remoting.Channel@16bd72d:5VLLTR1-ubuntu-server-vm Using strategy: Default Last Built Revision: Revision fbe7001a321737db2cc2b2b29e1ce80b05a7ad6b (origin/master) Cloning the remote Git repository Cloning repository origin ERROR: Error cloning remote repo 'origin' : Could not clone git@ourserver.com:/testing.git hudson.plugins.git.GitException: Could not clone git@ourserver.com:/testing.git at hudson.plugins.git.GitAPI.clone(GitAPI.java:251) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1122) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: hudson.plugins.git.GitException: Command "/usr/local/bin/git clone --progress -o origin git@ourserver.com:/testing.git /var/jenkins/workspace/Test/gcc/5VLLTR1-ubuntu-server-vm" returned status code 128: stdout: stderr: fatal: Could not get current working directory: No such file or directory at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:818) at hudson.plugins.git.GitAPI.access$000(GitAPI.java:39) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:247) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:227) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.git.GitAPI.clone(GitAPI.java:227) ... 12 more Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1134) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2196) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {code}
    via by Ryan Lovelett,
    • hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1042) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2099) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:287) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)
    No Bugmate found.