After upgrading Gerrit to 2.4.1, replication stopped working for us. Searching the logs, this mailing list, and Google, yielded no solution, so we're
asking for your help.
Before the upgrade, replication worked like a charm.
Now, the log shows:
[2012-07-01 13:44:02,772] ERROR com.google.gerrit.server.git.PushReplication : Cannot replicate to g...@git.assembla.com:mainrepo.git
org.eclipse.jgit.errors.TransportException: g...@git.assembla.com:mainrepo.git: reject HostKey: git.assembla.com
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:141)
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.google.gerrit.server.git.PushOp.listRemote(PushOp.java:379)
at ........
The ssh keys or known_hosts seem to not be the problem, as apparently we can ssh to the target machine (when logged-in as gerrit2):
Any other ideas or pointers on how to debug this?
I just encountered similar problems but was not able to restore an old version of the known_hosts file.The solution to get gerrit replicating again is quite simple:# remove any ecdsa entries in the known_hosts file using known hostnames:$ ssh-keygen -R hostname -f ~/.ssh/known_hosts# or manually delete offending lines from the file# to find the correct line number, you could pass -v to an ssh call and grep for known_hosts:$ ssh -v gerrit2@hostname 2>&1 | grep known_hosts:debug1: Found key in /home/gerrit2/.ssh/known_hosts:4$ sed -i 'd4' ~/.ssh/known_hosts # if it was line number 4# explicitly add rsa key from host:$ ssh-keyscan -t rsa hostname >> ~/.ssh/known_hosts# optionally you can re-hash the contents of the known_hosts file:$ ssh-keygen -H -f ~/.ssh/known_hosts