Im trying to setup jekins with Git. When i try to run the job it gives me
FATAL: Failed to fetch from git@bitbucket.org:xyzlk/xyzlk-services.git
hudson.plugins.git.GitException: Failed to fetch from git@bitbucket.org:xyzlk/xyzlk-services.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:647)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:889)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:914)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1253)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@bitbucket.org:xyzlk/xyzlk-services.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1437)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1225)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:87)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:282)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:645)
... 10 more
I have assign the user group who has the permission to access the repo to tomcat7. Still no luck.
Im my jenkins configuration i have added
git@bitbucket.org:xyzlk/xyzlk-services.git as the repo and Kind as SSH username with private key. User name of the user who has the access to repo and entered the key directly. Still no luck :(
Permissions
drwxr-xr-x 10 root root 4096 Oct 15 2013 usr
drwxr-xr-x 138 root root 4096 Oct 10 09:46 share
drwxr-xr-x 7 tomcat7 root 4096 Oct 13 08:23 tomcat7
inside tomcat
drwxr-xr-x 2 tomcat7 tomcat7 4096 Oct 13 05:31 .ssh
inside .ssh
drwxr-xr-x 2 tomcat7 tomcat7 4096 Oct 13 05:31 .
drwxr-xr-x 7 tomcat7 root 4096 Oct 13 08:23 ..
-rwxr-xr-x 1 tomcat7 tomcat7 1679 Oct 13 05:25 id_rsa
-rwxr-xr-x 1 tomcat7 tomcat7 406 Oct 13 05:25 id_rsa.pub
-rwxr-xr-x 1 tomcat7 tomcat7 1326 Oct 13 05:29 known_hosts