Unable to access private git repositories using Hudson

北城余情 提交于 2019-12-08 07:16:50

问题


I'm getting the below error:

Started by user anonymous
Checkout:workspace / /var/lib/hudson/jobs/test2/workspace - hudson.remoting.LocalChannel@1e77243d
Using strategy: Default
Checkout:workspace / /var/lib/hudson/jobs/test2/workspace - hudson.remoting.LocalChannel@1e77243d
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:rampelli/test.git
ERROR: Cause: Exception caught during execution of fetch command
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:913)
        at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:845)
        at hudson.FilePath.act(FilePath.java:758)
        at hudson.FilePath.act(FilePath.java:740)
        at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:845)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:622)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1479)
        at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
        at hudson.model.Run.run(Run.java:1366)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:145)

Without generating the ssh-keygen I was able to access public git Repositories, but after adding ssh-keygen I was unable to access private git repositories.


回答1:


Its fixed by just moving the .ssh folder to /var/lib/hudson/ folder and giving hudson access to .ssh files by just chown hudson:hudson .ssh/* It worked :)



来源:https://stackoverflow.com/questions/8832596/unable-to-access-private-git-repositories-using-hudson

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!