【问题标题】:jenkins complains host key verification failure although the key was generatedjenkins 抱怨主机密钥验证失败,尽管密钥已生成
【发布时间】:2012-05-30 05:22:14
【问题描述】:
Error:
Fetching upstream changes from git@github.com:....../.........git
    ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
    hudson.plugins.git.GitException: Error performing command: git fetch -t git@github.com:....../......git +refs/heads/*:refs/remotes/origin/*
    Command "git fetch -t git@github.com:...../......git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Host key verification failed.
    fatal: The remote end hung up unexpectedly

我的cmets:

  1. 我发现jenkins build在执行时失败了

    git fetch -t git@github.com:...../......git +refs/heads/*:refs/remotes/origin/*
    
  2. 然后我将相同的命令粘贴到它成功执行的命令行上,奇怪!

  3. 执行以下操作以确保密钥有效:

    ssh -T git@github.com
    Hi [username]! You've successfully authenticated, but GitHub does not provide shell access.
    

    建议在http://help.github.com/ssh-issues/

  4. 我确实尝试将生成的私有 ssh 密钥复制到 Jenkins 下的 .ssh 文件夹中

    cp -rf /root/.ssh /var/lib/jenkins/.ssh
    

    并将 .gitconfig 文件复制到 /var/lib/jenkins

    建议于:Jenkins fails with github "git clone"

【问题讨论】:

  • 它指的是主机密钥,而不是您的公钥/私钥。
  • 当您在命令行上尝试时,您是否以运行 Jenkins 的同一用户身份运行?您需要将主机密钥添加为 Jenkins 用户的允许主机。
  • 致罗伯特:谢谢,我会检查一下
  • 致 codemonkey:是的,来自 Jenkins Web,我以自己的身份登录以运行配置的构建。但是,我在 jenkins 系统中做了一个“sudo”,以便在命令提示符下执行它。我将尝试建议的后者,看看是否能解决问题。非常感谢。
  • 已修复:.git 归 root 所有,而其他归 jenkins 所有。解决方法是:happy-coding.com/…

标签: git ubuntu github hudson jenkins


【解决方案1】:

固定:

但我没有在项目中松动任何密集的配置。所以删除它并重新创建另一个。而这一次............我刚刚登录系统并 ** DID NOT SUDO ** 来创建 git config 。相反,只需执行 git config user.email "emailid@abc.com" 和 git config user.name "User name" 。jenkins 构建成功!

替代解决方案:.git 归 root 所有,而其他归 jenkins 所有。解决方法是:happy-coding.com/…

【讨论】:

    猜你喜欢
    • 2013-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-10
    • 2021-12-25
    • 1970-01-01
    • 1970-01-01
    • 2018-10-04
    相关资源
    最近更新 更多