jenkins 从2.360 升级到2.361 出现了如下问题(以前构建一直没有问题)
参考如下
Verifying host key using known hosts file, will automatically accept unseen keys
> /usr/bin/git fetch --tags --force --progress -- xxxxxx +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@git.yonyou.com:yyit/tanxingfuli-api.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1003)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1244)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)
at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:143)
at hudson.scm.SCM.checkout(SCM.java:540)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
at hudson.model.Run.execute(Run.java:1899)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:107)
at hudson.model.Executor.run(Executor.java:449)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- xxxx +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: command-line line 0: unsupported option "accept-new".
fatal: 无法读取远程仓库。
请确认您有正确的访问权限并且仓库存在
怀疑是git 版本问题,同时进行了升级,但是没用,同时也怀疑是因为升级造成配置的key 不能使用,重新配置了key 也是没有用,但是直接在slave 节点进行
clone 代码是没有问题的,然后怀疑是新的对于安全有什么配置变动,结果发现一个配置的确是变动了,成为了first
目前直接将此配置修改为不进行校验,问题解决,大致的原因应该是安全问题日益突出,jenkins 为了安全,调整了一些默认的安全配置参数
以上问题解决花了差不多半天时间,以后升级还是得多看看官方文档,才能有备无患
https://www.jenkins.io/changelog/
https://github.com/jenkinsci/jenkins/releases/tag/jenkins-2.361
https://github.com/jenkinsci/ghprb-plugin/issues/733
https://stackoverflow.com/questions/21383806/how-can-i-force-ssh-to-accept-a-new-host-fingerprint-from-the-command-line