我试图让gerrit的github复制工作。我可以使用以下方法直接克隆空存储库:git clone git@github.com:jpgrace / gerrit-test.git,但每当我尝试使用gerrit复制任何内容时,某些内容都会失败。如果我通过ssh或web应用程序运行replicate命令并不重要。我在etc / error_log
中得到了同样的错误如果我直接运行复制,
$ ssh -p 29418 jpgrace@ubuntu.vm gerrit replication start
这是控制台输出:
gerrit: replication: not found
并写入error_log:
[2014-05-12 18:47:30,785] ERROR com.googlesource.gerrit.plugins.replication.ReplicationQueue : Cannot replicate to git@github:jpgrace/All-Projects.git
org.eclipse.jgit.errors.TransportException: git@github:jpgrace/All-Projects.git: unknown host
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:139)
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:483)
at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:427)
at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:420)
at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:368)
at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:351)
at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:267)
at com.googlesource.gerrit.plugins.replication.PushOne.access$000(PushOne.java:78)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:240)
at com.googlesource.gerrit.plugins.replication.PushOne$1.call(PushOne.java:237)
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:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
最初我认为我的ssh配置不对,或者我没有在gerrit用户下运行gerrit。我不明白的一件事是警告中的“未知主机”部分。
这是我的〜/ .ssh / config
Host github.com
User git
IdentityFile /opt/gerrit/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile /opt/gerrit/.ssh/known_hosts
这是“ps aux | grep gerrit”的相关输出
gerrit 2546 1.7 35.4 1138240 177464 pts/2 Sl 17:45 0:53 GerritCodeReview -jar /opt/gerrit/bin/gerrit.war daemon -d /opt/gerrit --run-id=1399931125.2524
这是我的replication.config:
[remote "github"]
url = git@github:/${name}.git
我错过了什么?
答案 0 :(得分:1)
我发现上面的错误消息有问题。我的replication.config指向:
github
不
github.com