I can confirm that using a newer version of git solves my first problem. However linux servers usually don't have the latest versions available (I am using SLES 11). I might have to install a newer git version manually.
My second problem was solved by, installing git on Jenkins master (yes only the slave node had git) and giving the user jenkins access to the git repository. /Sverre ----- Original Message ----- From: "Sverre Moe" <sve...@spacetec.no> To: jenkinsci-users@googlegroups.com Sent: Thursday, 18 April, 2013 8:51:05 AM Subject: Re: A couple of Git problems I have made sure that the user "build" on my slave node has access to the git repository, but my user "jenkins" on the Jenkins master does not have this access. Perhaps that is why. /Sverre ----- Original Message ----- From: "Kevin Fleming (BLOOMBERG/ 731 LEXIN)" <kpflem...@bloomberg.net> To: jenkinsci-users@googlegroups.com Sent: Wednesday, 17 April, 2013 10:57:40 PM Subject: Re: A couple of Git problems Yes, this is normal. The Git plugin is trying to verify that the URL you've entered appears to be valid and accessible, but if for any reason the Jenkins master can't reach the Git repository, you'll get this warning. ----- Original Message ----- From: jenkinsci-users@googlegroups.com To: jenkinsci-users@googlegroups.com At: Apr 17 2013 16:48:11 I don't have fast remote polling checked as I let pushes to github trigger my builds but I still get the error about git ls-remote. And I think it happens when master doesn't have the ssh keys to connect to github but the slave does. So my builds work fine but I get an error in my config. Will On 04/17/2013 12:48 PM, Mark Waite wrote: <blockquote> If you update to the most recent version of git-client-plugin (1.0.5 or later), you don't need the "-D" setting, since command line git is the default in the latest git-client-plugin versions. Regarding problem 1: I think it may be the old version of git you are running (1.6.0.2). Refer to https://issues.jenkins-ci.org/browse/JENKINS-17629 for a more detailed description of why the problem is related to the git version. Git versions after 1.6.2 do not have the problem Regarding problem 2: The git plugin advanced section has a "fast remote polling" setting. I believe that if you enable that, then the plugin will use "git ls-remote" from the master node without performing the operation on the slave node. You might check if the advanced configuration has fast remote polling enabled. If it does and you are concerned about the overhead due to polling, you might read Kohsuke Kawaguchi's "Git polling must die" posting which describes how to improve the responsiveness of your jobs and reduce git polling significantly. Mark Waite <blockquote> From: Sverre Moe <sve...@spacetec.no> To: jenkinsci-users@googlegroups.com Sent: Wednesday, April 17, 2013 7:08 AM Subject: A couple of Git problems I'm using Git with Jenkins and are having some problems. Have turned off JGit with -Dorg.jenkinsci.plugins.gitclient.Git.useJGit=false, because otherwise it would not work. I'm using the following Git Url in my project settings: ssh:// g...@git.company.com/packages/companyApp.git Problem 1: Unable to perform git clone to workspace. This is because Jenkins automatically creates the workspace directory. I have gone around this problem by performing a manually git clone git@git:/packages/companyApp into the project workspace directory before I start my first build. I have read somewhere that it was not recommended to clone the project into the workspace directory, but I'm not sure how else to set it up. Started by user anonymous Building remotely on Build-2 in workspace /home/build/jenkins/workspace/companyApp Checkout:companyApp / /home/build/jenkins/workspace/companyApp - hudson.remoting.Channel@c0e349:Build-2 Using strategy: Default selected Git installation does not exists. Using Default Last Built Revision: Revision b251d9ef240dbb3a2b4d18a16c67d65cb74d3de5 (origin/HEAD, origin/master) Cloning the remote Git repository Cloning repository ssh:// g...@git.company.com/packages/companyApp.git git --version git version 1.6.0.2 ERROR: Error cloning remote repo 'origin' : Could not clone ssh:// g...@git.company.com/packages/companyApp.git hudson.plugins.git.GitException: Could not clone ssh:// g...@git.company.com/packages/companyApp.git at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: hudson.plugins.git.GitException: Command "git clone -o origin ssh:// g...@git.company.com/packages/companyApp.git /home/build/jenkins/workspace/companyApp" returned status code 128: stdout: stderr: fatal: destination directory '/home/build/jenkins/workspace/companyApp' already exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:773) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:217) ... 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:1013) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387) 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:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Problem 2: In project configure u nder the field for Git repository URL it gives the following error message: Failed to connect to repository : Error performing command: git ls-remote -h ssh:// g...@git.company.com/packages/companyApp.git HEAD All I have supplied is the Git URL. The rest is default git settings for a project (mostly empty). Jenkins runs this procject build on a slave node. This slave node is run with user "build" and that user has access to g...@git.company.com (its public key is on git.company.com). This is evident since I am able to manually clone the project. /Sverre CONFIDENTIALITY This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly. -- 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-users+unsubscr...@googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out . -- 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-users+unsubscr...@googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out . </blockquote> -- 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-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out . </blockquote> -- 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-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out . CONFIDENTIALITY This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly. -- 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-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.