replication error: com.jcraft.jsch.JSchException: Auth cancel

1,981 views
Skip to first unread message

Debayan Ray

unread,
Sep 21, 2016, 9:05:45 AM9/21/16
to Repo and Gerrit Discussion
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
I am trying to set up replication to remote server (github.mycompany.com depicted as github.xxx.com) as per documentation but getting failure.

When I run the following command, I get this:

gerrit2@gerrit:~$ sudo su -c 'ssh g...@github.xxx.com echo' gerrit2
[sudo] password for gerrit2:
Warning: Permanently added 'github.xxx.com' (ECDSA) to the list of known hosts.
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied (publickey).

Here is my ``replication.config`` file. 

[remote "github.xxx.com"]
    url = g...@github.xxx.com:${name}.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    timeout = 5
    replicationDelay = 0

The tricky part is it was able to replicate successfully earlier but mistakenly I have recreated my ssh keys on Gerrit server and from that time onwards I am facing this issue. I have also added the newly created ssh key (public key) to the github.xxx.com 's required admin users's profile, which has the ``write`` access to that repo.

The error I am facing is:

[2016-09-21 15:24:55,291] [d711efd1] Replication to g...@github.xxx.com:yyyyyy/my-project.git started...
[2016-09-21 15:24:57,099] [d711efd1] Cannot replicate to g...@github.xxx.com:yyyyyy/my-project.git
org.eclipse.jgit.errors.TransportException: g...@github.xxx.com:yyyyyy/my-project.git: Auth cancel
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
        at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
...
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.jcraft.jsch.JSchException: Auth cancel
        at com.jcraft.jsch.Session.connect(Session.java:511)
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)

How can i overcome this error. Should I set up a password somewhere for authentication? Please help.

Debayan Ray

unread,
Sep 21, 2016, 11:49:28 PM9/21/16
to Repo and Gerrit Discussion
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
Replication got resolved :-)

The new pair of ssh keys were created (when the earlier ones got mistakenly deleted) with passphrase... so that's why I was getting that Auth Cancel error as it requires manual provision of passphrase. Now that I have recreated the ssh keys with no passphrase the replication has resumed successfully. Btw, thanks everyone.
Reply all
Reply to author
Forward
0 new messages