Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replication failed for private gitlab server #123

Open
yihongyuelan opened this issue Dec 19, 2019 · 2 comments
Open

Replication failed for private gitlab server #123

yihongyuelan opened this issue Dec 19, 2019 · 2 comments

Comments

@yihongyuelan
Copy link

yihongyuelan commented Dec 19, 2019

I'm running 3.0.4 gerrit in docker, and I got replication fail log as below:
Caused by: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://[email protected]:22: org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host 'git.xx.com' can't be established. RSA key fingerprint is 4e:87:0d:3d:c4:4a:5f:21:b5:af:22:99:41:02:de:0d.

replication.config:
[remote "git.xx.com"]
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

I want to know where to config the ssh keys?I've tried these two options, but replication still failed.

  1. docker exec -it myGerrit /bin/bash and then ssh-keygen -t rsa -C [email protected], cat /root/.ssh/id_rsa.pub and add to private gitlab server. Add /root/.ssh/config file:
    Host git.xx.com:
    IdentityFile ~/.ssh/id_rsa
    PreferredAuthentications publickey

Opiton 1 result: Caused by: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://[email protected]:22: org.eclipse.jgit.transport.CredentialItem$YesNoType:The authenticity of host 'git.xx.com' can't be established. RSA key fingerprint is 4e:87:0d:3d:c4:4a:5f:21:b5:af:22:99:41:02:de:0d.

  1. docker exec -it myGerrit /bin/bash and then su -s /bin/bash gerrit2, and process ssh-keygen -t rsa -C [email protected]. cat ~/.ssh/id_rsa.pub and add to private gitlab server. Add /var/gerrit/.ssh/config file (If switch to gerrit2, cd ~ then the home path is /var/gerrit):
    Host git.xx.com:
    IdentityFile ~/.ssh/id_rsa
    PreferredAuthentications publickey

Option2 result: Cannot replicate to [email protected]:my-group/GerritTest.git org.eclipse.jgit.errors.TransportException: [email protected]:my-group/GerritTest.git: Auth fail

If I generate a ssh key, both two options process ssh -T [email protected] success (outputs:elcome to GitLab, gerrit.admin!)

My question is how to config replication plugin for gerrit in docker.

Thanks
BR

@yihongyuelan yihongyuelan changed the title Replication faild for private gitlab server Replication failed for private gitlab server Dec 19, 2019
@thinkernel
Copy link
Contributor

I've never used replicating over ssh. I'm using http instead. However, according to the document. The format of local user's key should be pem. I wounder if this info may helps.

@w-huaqiang
Copy link

@yihongyuelan Did you solve it? I also have this problem on k8s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants