UnknownHostException in eclipse egit - eclipse

I'm trying to use git from eclipse. I'm using Eclipse Kepler and Egit 3.0.
All local commands work fine, but I can't connect to the repo.
For example, fetch fails with java.net.UnknownHostException: my-server.
The .git for the project is configured so that the origin is set to ssh://my-server/my-project.git
The command git fetch origin works fine from outside eclipse.
my-server is an alias that is not set in the DNS, just in the ssh configuration (it is not accessible from the OS, but it is from the ssh client).
In window->preferences->ssh2, the ssh2 home is set to the .ssh folder of the machine (the one used by the ssh client that accesses origin just fine).
It would seem that the ssh configuration is not accessed properly. Any idea what's wrong, or how I could debug this (for example, the logs of the ssh connection attempt) ?

UnknownHostException indicates a DNS failure or some kind. Sounds like "it is not accessible from the OS, but it is from the ssh client" applies only to the command line ssh client. Eclipse uses Java library implementations of ssh2 and git, not the command line clients.
Basically, stop using aliases.

Related

What is the other local host server for sonar, since local 9000 is not working?

What is the other local host server for sonar, since local 9000 is not working? Should the command prompt be running in the background while using the local host? Since whenever I try to open start sonar the command prompt automatically closes.
This issue usually occurs if Java version being used is not Java 11. Therefore, do make sure that the installed java version is JAVA 11 only, as Sonarqube seems to have few compatibility issues when tried with other java versions.
How to download JAVA 11 ?
Download the zip from this link.
Say you have downloaded "openjdk-11.0.2_windows-x64_bin" in this location - "D:\openjdk-11.0.2_windows-x64_bin", then configure the following ENVIRONMENT_VARIABLES with values mentioned below:
a. JAVA_HOME - D:\openjdk-11.0.2_windows-x64_bin
b. PATH - D:\openjdk-11.0.2_windows-x64_bin\jdk-11.0.2\bin
Once this is done, you can make sure JAVA 11 is installed and configured by entering "java -version" in the command prompt window

"Algorithm negotiation fail" error in Eclipse when trying to connect by SSH to a personal Git Server

I have Eclipse Juno, a Synology Server DS213+ with a Git Server. I'm trying to checkout a project from my Git Server to my workspace and when I use EGit in Eclipse I have this error:
org.eclipse.jgit.api.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:159)
at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:99)
at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:324)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:202)
... 4 more
Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)
at com.jcraft.jsch.Session.connect(Session.java:320)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
... 8 more
[route] is correct and works fine in other git softwares
I found this blog with the solution:
http://blog.millard.org/2014/11/repair-synology-dsm51-for-use-as-linux.html
Using WinSCP http://winscp.net/eng/download.php I modified sshd_config and restart ssh in the Control Panel of Synology.
Egit in Eclipse seems to throw this error when it does not support any of the chipers supported the the ssh server. In my case, the SSH server was set to only accept a handful of strong chipers. I noticed errors similar to the following on the server's ssh logs:
fatal: Unable to negotiate with xx.xx.xx.xx port 12345: no matching cipher found. Their offer: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
The reason for the error on the client was because the default Java install did not support any of the strong chipers. Since we were already using the webupd8 team ppa to install our Java packages, the solution was to simply install the unlimited-jce-policy package.
apt install oracle-java8-unlimited-jce-policy
Restart Eclipse and you're all set.
Eclipse require diffie-hellman-group1-sha1
Modify /etc/ssh/sshd_config and add it to Ciphers like:
Ciphers 3des-cbc,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc#lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm#openssh.com,aes256-gcm#openssh.com,chacha20-poly1305#openssh.com
macs umac-64-etm#openssh.com,umac-128-etm#openssh.com,hmac-sha2-256-etm#openssh.com,hmac-sha2-512-etm#openssh.com,hmac-sha1-etm#openssh.com,umac-64#openssh.com,umac-128#openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
kexalgorithms curve25519-sha256,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
Managed to handle it with egit version 5.2
https://archive.eclipse.org/egit/updates-5.2/

In an eclipse based IDE, how do you access remote files through two ssh connections?

I'm working remotely and I need to access files on a server that's only accessible through ssh from another machine.
For example if my files are on server2, I need to ssh me#server1 then once I'm on that machine, ssh me#server2
Is there a way to set up remote systems in eclipse (I'm using Zend Studio) to get access to my files?
Thanks.
The short answer is No, however you you do have some options...
Eclipse is only aware of files in an Eclipse workspace (with some exceptions), thus you need to make your files available to your Eclipse instance. To do so, you could download the remote files and make them available locally or make te files accessible via a network share.
All in all, you need to make those files available on a file system visible to the local Eclipse instance. Once that is done, you can add/import the file into your Eclipse workspace.

Eclipse 'Add CVS Repository' hangs on known-good settings

I have a CVS server which is known to be ok (works from other machines).
I am trying to set up Eclipse to connect from an Ubuntu box.
The following command-line command succeeds:
cvs -d ':extssh:myuser#myhost/path/to/repository' checkout myrepository
Yet when I do Eclipse 'Add CVS Repository' it hangs on this, using both extssh and pserver protocols. extssh using port 22.
(There's no error message, it just hangs. Regardless whether 'Validate connection on finish' is on or off.)
I verified that all of the settings are ok. Port 22 is not blocked.
I double-checked Preferences under 'General>Network Connections' and 'Team>CVS'
I do not think it is an issue with keyless ssh either.
This is on an Ubuntu box, but these exact same Eclipse CVS client settings succeed from a Mac box.
(The Ubuntu box uses 9.10, and Eclipse is installed as EasyEclipse 1.3.1, installed as user, not root.
Plugin org.eclipse.team.* versions are:
(Ubuntu)
org.eclipse.team.cvs.ssh,.ssh2 3.2.100
org.eclipse.team.ui,.core,.cvs.core,.cvs.ui 3.3.r33x_2007...
(Mac)
org.eclipse.team.cvs.ssh2 3.2.300
org.eclipse.team.ui,.cvs.core,.cvs.ui 3.5.100.l20100527-0800
(EasyEclipse prevents me from upgrading the Ubuntu plugins, it insists these 4-year-old ones are the latest. Maybe an argument against using EasyEclipse.)
How to troubleshoot? How to trace what is actually happening inside Eclipse?
(as 'cvs -t -t' would give)
(As a sidebar, Eclipse should actually be printing a proper error message.
I've checked every appnote and userguide I can find with Google.)
Consensus was that EasyEclipse prevents user from upgrading the (4-year-old) Ubuntu plugins, insists that 3.3.x are the latest available, which cause this hang.
As of 5/2011, EasyEclipse is retired unless a new maintainer steps up.

Perforce client root remapping

I am very new to Perforce so this might be a dumb question.
All the sources I work against are checked out in a Linux server and the location is shared via Samba. I mount that location on a client Windows machine so I can work but I am finding I cannot use the local Perforce binary on my client machine because of workspace path mismatches.
Can I configure p4 clients so that I can "remap" workspace paths locally?
Have a look at the AltRoots field in the client spec. It should let you specify that the two directory paths are the same client.