| Summary: | EGit searches for the SSH keys in default dir rather than the one specified in preferences | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Alexander Abdugafarov <fswork90> | ||||||
| Component: | JGit | Assignee: | Thomas Wolf <twolf> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | fswork90, matthias.sohn, twolf | ||||||
| Version: | 4.9 | ||||||||
| Target Milestone: | 4.9.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 8 | ||||||||
| See Also: |
https://git.eclipse.org/r/110345 https://git.eclipse.org/c/jgit/jgit.git/commit/?id=adbf0935e105819f6b8f65325013b6def6205f18 |
||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Alexander Abdugafarov
Created attachment 271049 [details]
Error pop-up
In the meantime, workarounds I found: 1) Create a symbolic link from configured folder to default path 2) Use external Git client for pushing/fetching (which kinda voids the benefits of EGit) Duplicate of big 398085? The only thing that makes me wonder is that you say this issue was new in 4.9.0. What _is_ new in 4.9.0 is that we taught Jsch (the Java ssh library used by EGit and JGit) to honor ~/.ssh/config more completely. (And bug 398085 means that when the user specifies a different directory in the UI, we'll still read ~/.ssh/config instead of <user-specified directory>/config. But that was like this already before 4.9.0.) I wonder if this problem could be a side-effect of that change... Do you have a file C:\Users\FS\.ssh\config, and if so, can you show it in its entirety? Because of https://git.eclipse.org/r/#/c/99067/ it _is_ possible that some IdentityFile settings that were previously ignored now are considered, and if they're incorrect might lead to such exceptions. I don't see how https://git.eclipse.org/r/#/c/99067/ could otherwise cause this. It doesn't touch the JSch "IdentityRepository" nor the loading of the keys defined in the UI. No, in fact, the folder C:\Users\FS\.ssh itself was non-existent until I manually made a symbolic link pointing to D:\_Home\.ssh as a workaround for this issue. (In reply to Alexander Abdugafarov from comment #4) > No, in fact, the folder C:\Users\FS\.ssh itself was non-existent until I > manually made a symbolic link pointing to D:\_Home\.ssh as a workaround for > this issue. Aha. And do you have a file D:\Home\.ssh\config, and if so, can you show that? Sure: Host github.com IdentityFile ~/.ssh/id_rsa_unprotected Host openshift-simplelogics Hostname simplelogics-frozenspider.rhcloud.com User 54572a90e0b8cd2518000660 IdentityFile ~/.ssh/id_rsa_unprotected Host sl Hostname simplelogics-frozenspider.rhcloud.com User 54572a90e0b8cd2518000660 IdentityFile ~/.ssh/id_rsa_unprotected I should also add that I have a %HOME% env var pointing to D:\_Home\.ssh Damn, how do I edit the comment?.. I've meant "pointing to D:\_Home\" Just confirmed: reverting to 4.8.0 resolves the issue (In reply to Alexander Abdugafarov from comment #9) > Just confirmed: reverting to 4.8.0 resolves the issue This appears to be a Windows-specific problem relating to the way the Java system property "user.home" is set. In JGit 4.8.0, the Jsch library ignored the .ssh/config file completely; it was parsed and ~ was replaced in JGit only. In JGit 4.9.0, we still parse .ssh/config correctly and replace ~ in JGit correctly, but we also give that parsed config file to Jsch. Jsch then picks up the IdentityFile again. It finds the original value as parsed with the ~ and then replaces ~ by the Java system property "user.home". According to the JDK 8 release notes[1] and to JDK bug 6519127[2] "user.home" is on Windows not set to the value of %HOME% but of %USERPROFILE%. So Jsch replaces ~ by your real home directory, and then cannot find the key file and throws this nasty exception. When JGit (not Jsch) does the ~ replacement on Windows, it considers the following values in this order: 1. %HOME% 2. %HOMEDRIVE%/%HOMEPATH% 3. %HOMESHARE% 4. user.home So https://git.eclipse.org/r/#/c/99067/ does the replacement correctly as it was in 4.8.0, but since newly Jsch also sees the ~ and does the replacement differently, we get into troubles. On Linux and Mac, JGit also simply uses "user.home" to replace the tilde, so there's no difference in behavior. Patch a-coming. [1] http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html#A999387 [2] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6519127 New Gerrit change created: https://git.eclipse.org/r/110345 @Alexander: could you please double-check what the value of the system property user.home in your Eclipse is? It's shown when you go to "About Eclipse", "Installation Details", "Configuration" tab. You are correct: user.home=C:\Users\FS Gerrit change https://git.eclipse.org/r/110345 was merged to [stable-4.9]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=adbf0935e105819f6b8f65325013b6def6205f18 @Alexander: the fix should now be available in the EGit/JGit nightly versions (update site: http://download.eclipse.org/egit/updates-nightly/ ). Would be great if you could verify that this now works as expected. @Thomas: Confirmed, in my case EGit uses the intended folder and not %USERPROFILE%/.ssh Thanks! Thank you very much for double-checking! |