score:46

Accepted answer

it sounds like egit is looking for an ssl certificate and refusing to function without it. a good fix to make the problem go away and stay away: window→preferences→team→git→configuration→new entry→http.sslverify=false.

that should take care of it.

score:0

restarting eclipse resolved this problem for me.

score:0

i accidently found out simply changing protocol to git can fix it with egit 1.2.

score:0

i had the same problem, when i just generated my new ssh2 key in eclipse, but not set into the private keys field... (window --> preferences --> general --> network connection --> ssh2 --> (general tab) --> add private key...)

score:0

i did the following steps in my eclipse when i had issue with auth fail and unexpected exception even after setting the ssh key with github from mylaptop. i pointed the correct .ssh path in windows >> preferences ... >> network ..>> ssh2.

  • go to github web interface
  • click on the repository
  • click on ssh hyperlink just below the 'copy clone url'
  • click on the copy icon; it shows git@git.mycompany.com
  • open the eclipse(sts,ggts etc) it is having the git plugin
  • open git perspective and then just right click on git repositories pane which showed an option to 'paste the repository path or uri'
  • this cloned the repo successfully.

score:0

i resolved this issue changing active provider to direct in network connections.

score:0

this was a stupid mistake on my part that i hope no one else has to encounter.

in the host field, i included www at the very beginning, so the complete uri looked something like, https://www.github.com/user-name/repo-name.git

when it should have only been https://github.com/user-name/repo-name.git

score:1

i think this error message is in some kind generic. my guess is the plug-in just catches an exception by the underlying commands (probably ssh, since execution fails on ls, which is likely the first command after a successful connection) and show it's own message ("execution of the ls command"). therefore it is hard to give a working answer. i tried daniel's answer it it didn't worked for me.

so i dug deeper and tried to manually clone the repository via

git clone username@host.path_to_repo

and it worked charming.

by doing so you test if your authentication method is what you expect and your .ssh/config is pretty as well.

knowing i could connect i assumed the error must be somewhere in eclipse/egit. for example i thought maybe the authentication method in the project import wizard was disturbing. (putting an ssh:// in front of the path, might interfering with .ssh/config - anyway: nope.)
or maybe the ssh settings for eclipse were wrong: window --> preferences --> general --> network connection --> ssh. oh, some of my keys were not listed. adding and restarting: same error -> frustration. all other settings looked fine. i couldn't find any good reason.

also my connection is not the best so every connection try takes a lot of time. desperately i re-checked window --> preferences --> team --> git --> and kabamm! i found the settings i actually was initially thinking it could be the troublemaker.

remote connection timeout (seconds): 30

as i said instead of lightning fast i feel more like a snail and git-plugin gave up before the server response even could reach me. at least that's my assumption 'cause since i've set the value to 120 i have more time to drink my tea and when i return there are all the branches ready to clone :)

score:1

my answer is for the same exception, but for cloning using ssh protocol.

i had it working in one workspace, but not the other one. i could also clone repository from command line so it was clear eclipse configuration issue.

i did compare config files in two workspaces. the thing that fixed it was in .metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jsch.core.prefs

there was a path to ssh directory: ssh2home=c\:\users\username\ssh

the correct path should have had a dot in front of ssh: ssh2home=c\:\users\username\.ssh

no idea how that got messed up, but make sure the path to ssh home is correct.

score:1

if your using debian based operating system you can try ssh service for cloning the git repository.

it working fine to me.

thanks, sengottuvel

score:1

when you generate the rsa ssh key in eclipse in : windows > preferences > general> network.. > ssh2 > key managment tab..

you should save as the private key and then continue. that solved my problem.

score:2

i also found that the default ssh2 directory assigned in

preferences > general > network connections > ssh2 > general > ssh2

home was c:\users\username\ssh instead of the default c:\users\username\.ssh (with a leading dot for "ssh")

using the browse button should help you to ensure that the proper directory is selected.

if this is relevant to you then changing the specified directory is all you need to eliminate the error messages.

score:2

in my case it was a two step solution on windows vista.

i am using an id_rsa certificate, so i needed to change the location in preferences > general > network connections > ssh2 > general > ssh2 to point to .ssh instead of ssh as was pointed out in an earlier solution. in addition to that, i had to give read access back to everybody (right click the file in windows explorer). i had previously denied access to everybody because my command line ssh client refused to work without doing so.

hope that helps.

score:3

not helpful in your case, but maybe helpful for others: i've seen this error come up when copying uris with scheme name git instead of something more common. if the uri starts with git://, try changing it to http:// or https://.

score:3

i was getting this error

cannot list the available branches. 
reason: 
exception caught during execution of ls-remote command.

when trying with ssh key and maybe wrong url for bitbucket:
wrong? ssh://git@bitbucket.com/user/repository.git

it worked (branches listed) with this url:
git@bitbucket.org:user/repository.git

score:5

this worked for me.

1) in eclipse, window -> preferences -> general -> network connections -> ssh2 (or else just type ssh2 on search filter). go to "key management" tab. click on "generate rsa key". you can now see the generated key information. copy this generated key. keep this window open and do step 2.

2) go to github account.click on your profile -> manage account -> ssh keys -> add key. now paste the previously copied key and then "add key".

3) now go back to eclipse preferences window. click "save private key" to save rsa key to a file. by defaults this will be saved to users\user_name\.ssh directory. providing passphrase is optional here.

that's all, now restart eclipse and clone the repository.

score:19

adding .git to the repository url worked for me.


Related Query

More Query from same tag