Gerrit - 复制到github [英] Gerrit - Replicating to github

查看:284
本文介绍了Gerrit - 复制到github的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过

  [remotegithub] 
url = git@github.com配置了gerrit复制: MYUSERNAME / $ {name} .git
push = + refs / heads / *:refs / heads / *
push = + refs / tags / *:refs / tags / *
timeout = 5
replicationDelay = 0
authGroup =管理员

我可以登录到github与gerrit2用户尽可能从github网站获得允许。 Github在已知的主机中。
然而,我得到以下错误:

  [2013-06-04 20:04:54,472] ERROR com。 googlesource.gerrit.plugins.replication.ReplicationQueue:无法复制到git@github.com:MYUSERNAME / All-Projects.git 
org.eclipse.jgit.errors.TransportException:git@github.com:MYUSERNAME / All- Projects.git:拒绝HostKey:github.com $ b。在org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
$ b在org.eclipse.jgit.transport.SshTransport.getSession( SshTransport.java:121)LT
。在org.eclipse.jgit.transport.TransportGitSsh $ SshFetchConnection&;初始化>(TransportGitSsh.java:248)
。在org.eclipse.jgit.transport.TransportGitSsh.openFetch (TransportGitSsh.java:147)
在com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:409)在com.googlesource.gerrit.plugins.replication.PushOne.doPushAll
(PushOne.java:357)
at com.googlesource.gerrit.plugins.replication.PushOne.genera teUpdates(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)
处com.googlesource.gerrit.plugins.replication.PushOne com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:207)
。在com.googlesource.gerrit.plugins.replication.PushOne $ 1.call(PushOne.java:186)
上访问$ 000(PushOne.java:71)
,位于com.googlesource.gerrit.plugins.replication。 PushOne $ 1.call(PushOne.java:183)
,位于com.google.gerrit.server.util.RequestScopePropagator $ 5.call(RequestScopePropagator.java:222)
,位于com.google.gerrit.server。 util.RequestScopePropagator $ 4.call(RequestScopePropagator.java:201)维持在com.googlesource com.google.gerrit.server.git.PerThreadRequestScope $传播者$ 1.call(PerThreadRequestScope.java:75)

。 gerrit.plugins.replication.PushOne.run(PushOne.java:183)$ j $ j jav a.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:441)$ java.util.concurrent.FutureTask
$ Sync.innerRun(FutureTask.java:303)
at java.util。 concurrent.FutureTask.run(FutureTask.java:138)在java.util.concurrent.ScheduledThreadPoolExecutor中$ ScheduledFutureTask.access
$ 301(ScheduledThreadPoolExecutor.java:98)
在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 )
由com.jcraft.jsch.JSchException引起:拒绝HostKey:github.com
在com.jcraft.jsch.Session.checkHost(Session.java:712)
at com。 jcraft.jsch.Session.connect(Session.java:313)
at o rg.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]错误com.googlesource.gerrit.plugins.replication.ReplicationQueue:无法复制到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:拒绝HostKey:ssh.github.com $在org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)b
$在org.eclipse.jgit.transport b INIT> .SshTransport.getSession(SshTransport.java:121)$ b $ LT b。在org.eclipse.jgit.transport.TransportGitSsh $ SshFetchConnection&(TransportGitSsh.java:248)
。在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)$在com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:252)b
$ b。在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)
,位于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)$ java.util.concurrent.Executors $ b $ $ $ RunnableAdapter.call(Executors.java:441)$ b $ java.util.concurrent.FutureTask $ b $ .innerRun(FutureTask.java:303)
在java.util.concurrent.FutureTask.run(FutureTask.java:138)
在java.util.concurrent.ScheduledThreadPoolExecutor中$ ScheduledFutureTask.access $ 301(的ScheduledThreadPoolExecutor。的java:在com.google.gerrit.server.git.WorkQueue $ Task.run(工作队列在java.util.concurrent.ScheduledThreadPoolExecutor中$ ScheduledFutureTask.run 98)
(ScheduledThreadPoolExecutor.java:206)
。 java:337)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)$ b $ at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)
在java.lang.Thread.run(Thread.java:662)
引起:com.jcraft.jsch.JSchException:拒绝HostKey:ssh.github.com
在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


解决方案

作为Gerrit正在运行的用户登录(通过SSH)。



我建议你设置一个〜/ .ssh / config



 主机github.com 
用户git
IdentityFile / path / to / the / private / key
StrictHostKeyChecking no
UserKnownHostsFile / dev / null

如果您可以通过来连接,那么您的SSH密钥将忽略关于(最初)未知主机的警告。 ssh github.com ,我们快到了。然后尝试使用SSH URL克隆Github存储库。



然后让Gerrit尝试再次复制。



另外,我建议从 replication.config 中删除​​ authGroup 设置。


I configured gerrit replication via

[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

I can log in to github with the gerrit2 user as far as it is allowed from github site. Github is in the known hosts. However I get the following error:

[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

Similar problem for ssh access with

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

解决方案

Log in (via SSH) as the user under which Gerrit is running.

I recommend you to set up a ~/.ssh/config for the Gerrit user like this:

Host github.com
    User git
    IdentityFile /path/to/the/private/key
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

This sets up your SSH key ignores warnings about the (initially) unknown host.

If you can then connect via ssh github.com, we're almost there. Then try to clone the Github repository using the SSH URL.

Afterwards let Gerrit try to replicate again.

Plus then I would recommend to remove the authGroup setting from the replication.config.

这篇关于Gerrit - 复制到github的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆