【发布时间】:2014-05-13 14:13:34
【问题描述】:
我正在尝试让 gerrit 的 github 复制工作。我可以直接使用 git clone git@github.com:jpgrace/gerrit-test.git 克隆一个空的存储库,但是每当我尝试使用 gerrit 复制任何东西时,都会失败。我是通过 ssh 还是在 Web 应用程序上运行复制命令都没有关系。我在 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
我错过了什么?
【问题讨论】:
标签: java github ssh replication gerrit