首页 > 解决方案 > Gerrit 复制到 github 失败 w/TransportException: Auth fail

问题描述

我正在尝试按如下方式设置 Gerrit 复制插件:

[remote "github"]
    url = git@github.com:ORGNAME/${name}.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/heads/*:refs/tags/*
    threads = 3
    timeout = 30
    remoteNameStyle = dash
    rescheduleDelay = 15

但是我遇到了身份验证错误,这看起来很奇怪,因为如果我输入

ssh -t git@github.com,

我明白了

Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.

无论如何,这是我在运行 gerrit.sh replication start --wait --all 时遇到的主要错误

[2019-02-18 12:37:51,084] [05b16c69] Replication to USERNAME@github.com:ORGNAME/REPONAME.git started...
[2019-02-18 12:37:51,089] [05b16c69] Push to USERNAME@github.com:ORGNAME/REPONAME.git references: [RemoteRefUpdate[remoteName=refs/heads/master, NOT_ATTEMPTED, (null)...5f80155dc87f4aca9e0f7ce8cbccbab3ff466c4a, srcRef=refs/heads/master, forceUpdate, message=null]]
[2019-02-18 12:37:51,697] [05b16c69] Cannot replicate to USERNAME@github.com:ORGNAME/REPONAME.git
org.eclipse.jgit.errors.TransportException: USERNAME@github.com:ORGNAME/REPONAME.git: Auth fail
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:192)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
    at org.eclipse.jgit.transport.TransportGitSsh$SshPushConnection.<init>(TransportGitSsh.java:339)
    at org.eclipse.jgit.transport.TransportGitSsh.openPush(TransportGitSsh.java:176)
    at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:160)
    at org.eclipse.jgit.transport.Transport.push(Transport.java:1346)
    at org.eclipse.jgit.transport.Transport.push(Transport.java:1392)
    at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:452)
    at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:431)
    at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:316)
    at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:82)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:281)
    at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:278)
    at com.google.gerrit.server.util.RequestScopePropagator.lambda$cleanup$1(RequestScopePropagator.java:212)
    at com.google.gerrit.server.util.RequestScopePropagator.lambda$context$0(RequestScopePropagator.java:191)
    at com.google.gerrit.server.git.PerThreadRequestScope$Propagator.lambda$scope$0(PerThreadRequestScope.java:73)
    at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:285)
    at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:83)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:646)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(Session.java:519)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:146)
    ... 24 more

标签: gitgithubgerrit

解决方案


这可能与Github由于CVE-2015-4000删除了对弱加密标准的支持有关。如果您的 Gerrit 版本早于2.11.11,您将需要升级它以使复制到 Github 再次工作。


推荐阅读