我通过
配置了gerrit复制[remote "github"]
url = git@github.com:MYUSERNAME/${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 5
replicationDelay = 0
authGroup = Administrators
我可以使用gerrit2用户登录github,只要github网站允许。 Github在知名的房东。 但是我收到以下错误:
[2013-06-04 20:04:54,472] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to git@github.com:MYUSERNAME/All-Projects.git
org.eclipse.jgit.errors.TransportException: git@github.com:MYUSERNAME/All-Projects.git: reject HostKey: github.com
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:409)
at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:357)
at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:350)
at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:298)
at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)
at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:207)
at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:71)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:186)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:183)
at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:183)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:337)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.jcraft.jsch.JSchException: reject HostKey: github.com
at com.jcraft.jsch.Session.checkHost(Session.java:712)
at com.jcraft.jsch.Session.connect(Session.java:313)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
... 25 more
ssh访问的类似问题 与
url = ssh://git@ssh.github.com:443/MYUSERNAME/${name}.git
[2013-06-04 21:22:06,072] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to ssh://git@ssh.github.com:443/MYUSERNAME/All-Projects.git
org.eclipse.jgit.errors.TransportException: ssh://git@ssh.github.com:443/MYUSERNAME/All-Projects.git: reject HostKey: ssh.github.com
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:409)
at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:357)
at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:350)
at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:298)
at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)
at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:207)
at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:71)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:186)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:183)
at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:183)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:337)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.jcraft.jsch.JSchException: reject HostKey: ssh.github.com
at com.jcraft.jsch.Session.checkHost(Session.java:712)
at com.jcraft.jsch.Session.connect(Session.java:313)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
... 25 more
答案 0 :(得分:5)
以Gerrit正在运行的用户身份登录(通过SSH)。
我建议您为Gerrit用户设置~/.ssh/config
,如下所示:
Host github.com
User git
IdentityFile /path/to/the/private/key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
这会设置SSH密钥,忽略有关(最初)未知主机的警告。
如果您可以通过ssh github.com
进行连接,我们几乎就在那里。然后尝试使用SSH URL克隆Github存储库。
然后让Gerrit再次尝试复制。
另外,我建议您从authGroup
删除replication.config
设置。
答案 1 :(得分:1)
创建一个组“Github Export”并将该组只读取您想要导出的存储库(或明确拒绝All-Projects的读取访问权限,这是一个仅包含其他项目继承的设置的元项目) 。然后,当您设置authGroup = Github Export
时,仅导出该组有权访问的存储库。
请记住,因为Gerrit 2.5必须让所有成员都可以看到该组(这是该组的设置),这是由将该功能提取到插件中引起的。请参阅Gerrit列表存档。
另一个想法可能是使用this not yet merged patch,它允许您为要复制到某个遥控器的存储库设置模式。
最后一个选项是简单地忽略此错误消息。复制其他repos仍然可以正常工作。