我正在docker中运行gerrit,但现在我无法将提交复制到我们的私有gitlab服务器。
这是我的replication.config
[remote "git.server.com"]
url = url = [email protected]:my-group/${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
push = +refs/changes/*:refs/changes/*
threads = 3
rescheduleDelay = 15
[replication]
maxRetries = 1
[gerrit]
autoReload = true
replicateOnStartup = true
这是/var/gerrit/.ssh/config:
Host git.server.com:
User git
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey
和复制日志输出:
[2019-12-20 10:58:04,914] [a23c87d1] Push to [email protected]:my-group/All-Projects.git cancelled after maximum number of retries
[2019-12-20 10:58:32,606] [0220f3d3] Replication to [email protected]:my-group/All-Users.git started...
[2019-12-20 10:58:33,036] [0220f3d3] Cannot replicate to [email protected]:my-group/All-Users.git
org.eclipse.jgit.errors.TransportException: [email protected]:my-group/All-Users.git: Auth fail
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:191)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
at com.googlesource.gerrit.plugins.replication.PushOne.listRemote(PushOne.java:595)
at com.googlesource.gerrit.plugins.replication.PushOne.doPushAll(PushOne.java:534)
at com.googlesource.gerrit.plugins.replication.PushOne.generateUpdates(PushOne.java:523)
at com.googlesource.gerrit.plugins.replication.PushOne.pushVia(PushOne.java:464)
at com.googlesource.gerrit.plugins.replication.PushOne.runImpl(PushOne.java:454)
at com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:338)
at com.googlesource.gerrit.plugins.replication.PushOne.lambda$run$0(PushOne.java:299)
at com.google.gerrit.server.util.RequestScopePropagator.lambda$cleanup$1(RequestScopePropagator.java:182)
at com.google.gerrit.server.util.RequestScopePropagator.lambda$context$0(RequestScopePropagator.java:170)
at com.google.gerrit.server.git.PerThreadRequestScope$Propagator.lambda$scope$0(PerThreadRequestScope.java:70)
at com.googlesource.gerrit.plugins.replication.PushOne.run(PushOne.java:302)
at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:72)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:610)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
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:145)
我已经将/var/gerrit/.ssh/id_rsa.pub添加到我们的私有gitlab服务器(SSH密钥)。我也添加了一个问题here。
[我从openfrontier泊坞镜映像安装了Gerrit服务器,但是遇到了这些问题,但是经过几天的搜索,我终于从gerritcodereview泊坞镜映像重新创建了Gerrit服务器,现在一切正常。] >
我比较了gerritcodereview和openfrontier中的docker镜像,并且有很多差异。使用openfrontier,容器的默认用户是root,并且他们在启动gerrit之前创建了一些脚本,并且gerrit用户不可登录,您必须使用脚本来处理gerrit东西。
官方Gerrit码头工人镜像是gerritcodereview,容器的默认用户是gerrit,就像普通的gerrit服务器一样。我可以自己配置所有内容。