Skip to content

Replication failed for private gitlab server #123

@yihongyuelan

Description

@yihongyuelan

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://git@git.xx.com: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 = git@git.xx.com: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 gerrit.admin@xx.com, 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://git@git.xx.com: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 gerrit.admin@xx.com. 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 git@git.xx.com:my-group/GerritTest.git org.eclipse.jgit.errors.TransportException: git@git.xx.com:my-group/GerritTest.git: Auth fail

If I generate a ssh key, both two options process ssh -T git@git.xx.com success (outputs:elcome to GitLab, gerrit.admin!)

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

Thanks
BR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions