[英]Git authentication failing on jenkins with hudson after upgrading to Mojave
我們的CI(Jenkins)之前使用標准的主從配置工作在High Sierra,其中主服務器在構建時為從服務器提供ssh憑證。 升級到mojave后,我們的所有構建都失敗了以下消息:
21:29:33 Fetching changes from the remote Git repository
21:29:33 > git config remote.origin.url git@github.com:myrepo/ios.git # timeout=10
21:29:33 Pruning obsolete local branches
21:29:34 Fetching upstream changes from git@github.myrepo/ios.git
21:29:34 > git --version # timeout=10
21:29:34 using GIT_SSH to set credentials For use with GitHub
21:29:34 > git -c core.askpass=true fetch --tags --progress git@github.com:myrepo/ios.git +refs/heads/master:refs/remotes/origin/master --prune # timeout=30
21:29:34 ERROR: Error fetching remote repo 'origin'
21:29:34 hudson.plugins.git.GitException: Failed to fetch from git@github.com:myrepo/ios.git
21:29:34 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:766)
21:29:34 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1022)
21:29:34 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1053)
21:29:34 at hudson.scm.SCM.checkout(SCM.java:485)
21:29:34 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
21:29:34 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
21:29:34 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
21:29:34 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
21:29:34 at hudson.model.Run.execute(Run.java:1738)
21:29:34 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
21:29:34 at hudson.model.ResourceController.execute(ResourceController.java:98)
21:29:34 at hudson.model.Executor.run(Executor.java:410)
21:29:34 Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress git@github.com:myrepo/ios.git +refs/heads/master:refs/remotes/origin/master --prune" returned status code 128:
21:29:34 stdout:
21:29:34 stderr: jenkins@github.com: Permission denied (publickey).
21:29:34 fatal: Could not read from remote repository.
21:29:34
21:29:34 Please make sure you have the correct access rights
21:29:34 and the repository exists.
21:29:34
21:29:34 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
21:29:34 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
21:29:34 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
21:29:34 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
21:29:34 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
21:29:34 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
21:29:34 at hudson.remoting.UserRequest.perform(UserRequest.java:120)
21:29:34 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
21:29:34 at hudson.remoting.Request$2.run(Request.java:326)
21:29:34 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
21:29:34 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
21:29:34 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
21:29:34 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
21:29:34 at hudson.remoting.Engine$1$1.run(Engine.java:62)
21:29:34 at java.lang.Thread.run(Thread.java:748)
21:29:34 at ......remote call to App_test_2(Native Method)
21:29:34 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
21:29:34 at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
21:29:34 at hudson.remoting.Channel.call(Channel.java:781)
21:29:34 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
21:29:34 at sun.reflect.GeneratedMethodAccessor414.invoke(Unknown Source)
21:29:34 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
21:29:34 at java.lang.reflect.Method.invoke(Method.java:497)
21:29:34 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
21:29:34 at com.sun.proxy.$Proxy84.execute(Unknown Source)
21:29:34 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:764)
21:29:34 ... 11 more
2
我對jenkins@github.com
用戶持懷疑jenkins@github.com
因為來自github的ssh克隆通常以git@github.com
形式完成。
有沒有人有關於如何修復此SSH錯誤的建議? 我可以提供更多細節嗎?
我上面的問題最有幫助的是這個Jenkins JIRA Bug: 用於使用OpenSSH 7.7的git clone的用戶名錯誤 。 確切的問題不一樣,但是底部列出的修復程序涉及在Jenkins Master上創建一組新的憑據,用戶名設置為“git”解決了我的問題。 重申一下,解決方法是使用Jenkins GUI設置一組新的ssh憑證,其中包含按Github文檔所述生成的新私鑰,並將該私鑰添加到Jenkins,確保更改默認用戶名“jenkins” “git”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.