【发布时间】:2014-12-06 23:40:29
【问题描述】:
我正在尝试使用 Git 设置 jekins。当我尝试运行它给我的工作时
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
我已将有权访问 repo 的用户组分配给 tomcat7。还是没有运气。
我已经添加了我的詹金斯配置
git@bitbucket.org:xyzlk/xyzlk-services.git 作为 repo 和 Kind 作为带有私钥的 SSH 用户名。有权访问repo并直接输入key的用户的用户名。还是没有运气:(
权限
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
在tomcat里面
drwxr-xr-x 2 tomcat7 tomcat7 4096 Oct 13 05:31 .ssh
在 .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
【问题讨论】: