Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
435 views
in Technique[技术] by (71.8m points)

Docker gerrit cant replicate to gitlab

I'm using openfrontier/Gerrit as the docker image to demonstrate CI workflow. I got stuck when replicating Gerrit changes to my private Gitlab running in another container. Here is the Relication log:

org.eclipse.jgit.errors.TransportException: git@bc092ba5a426:root/test1.git: remote hung up unexpectedly
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:271)
    ...
com.googlesource.gerrit.plugins.replication.PushOne.runPushOperation(PushOne.java:324)
    at com.googlesource.gerrit.plugins.replication.PushOne.lambda$run$0(PushOne.java:310)
    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:313)
    at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:87)
    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)
    ...
Caused by: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://git@bc092ba5a426:22: 
org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host 'bc092ba5a426' can't be established.
RSA key fingerprint is d1:31:0e:21:8b:86:bf:9c:97:42:76:5d:37:e9:6b:c7.
Are you sure you want to continue connecting?
    at org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider.get(UsernamePasswordCredentialsProvider.java:94)
    at org.eclipse.jgit.transport.CredentialsProviderUserInfo.promptYesNo(CredentialsProviderUserInfo.java:103)
    at com.jcraft.jsch.Session.checkHost(Session.java:793)
    at com.jcraft.jsch.Session.connect(Session.java:345)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:115)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:107)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:254)
    ... 22 more

openfrontier/gerrit version 3.2.5.1

'bc092ba5a426' is my Gitlab container host name and I run

ssh -vT git@bc092ba5a426 -p 29418

in Gerrit container successfully as both root user and gerrit2 user.

Configuration file in review_site/.ssh/config:

Host bc092ba5a426
IdentityFile ~/.ssh/id_rsa
PreferredAuthentications publickey

Replication configuration file in review_site/etc/replication.config:

[remote "gerrit-test"]  
    projects = gerrit-test
    url = git@bc092ba5a426:root/gerrit-test.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    push = +refs/changes/*:refs/changes/*
    threads = 3
    rescheduleDelay = 5
    timeout = 30

I have no idea why and how to solve this. Any advice? thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...