Unauthorized 401 when trying to clone [message #1744691] |
Thu, 29 September 2016 09:58  |
Eclipse User |
|
|
|
I am having trouble with the JGit/Egit plugins shipping with Neon.1.
When trying to clone a repository (over HTTPS), up pops a password prompt.
Entering credentials lets it fetch the list of branches. So jgit/egit does connect/authenticate with our Git server (Bitbucket Server).
But when jgit/egit attempts to complete the clone operation, it fails with a 401 Unauthorized message.
Same behavior with the 4.5.0 release, which I tried upgrading to.
The stack traces in the log matches those in this discussion:
https://www.eclipse.org/forums/index.php/t/1071866/
But as I read that thread, the fix should have been included in builds some 10 months ago?!?
So I am rather confused as to what might be the cause of this.
Any ideas? Does anyone else have this problem with Neon.1?
Fortunately the version shipping with Neon (still) works, so we have a safe haven of sorts. But we would obviously like to switch to Neon.1.
Thanks,
Jesper
|
|
|
|
|
Re: Unauthorized 401 when trying to clone [message #1744755 is a reply to message #1744736] |
Fri, 30 September 2016 00:21   |
Eclipse User |
|
|
|
Yes, I ran into the same problem this week. I spent a day debugging to figure out what was different in Neon.1 verses Neon.0. It turns out there was a change in Market Place Client such that it calls java.net.Authenticator.setDefault(Authenticator) with an Authenticator implementation that replaces the one registered by EGit, i.e., org.eclipse.egit.core.EclipseAuthenticator. I tracked down the change which does this and tracked that down to this Bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=501000
I haven't tried pushing yet, because it's a new project that I'm working on, so I was only trying to clone. But one subtle behavior I noticed, and that's perhaps a workaround for everyone, is that when you see a prompt for the password (the prompt without the check box to save it and without your user ID prefilled in the dialog), it's really MPC that's prompting for the password. If you enter a valid password, then EGit will not see a 401 response code, so EGit will not fill in your saved password when communicating with that server, hence the next EGit/JGit access will result in a 401 because the saved credentials are not being used. The tricky thing I noticed was that if I just hit escape or pressed cancel on the bogus password prompt, then EGit starts to work.
Note that if you use Oomph (the Eclipse Installer) to create your installation, there's a hack you can use to get it to install Neon.0 instead of Neon.1. In your IDE, use Navigate -> Open Setup -> User and then copy the following text for an Oomph redirection task from this post:
<?xml version="1.0" encoding="UTF-8"?>
<setup:RedirectionTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
sourceURL="http://download.eclipse.org/releases/neon/201609281000"
targetURL="http://download.eclipse.org/releases/neon/201606221000">
<description>Neon.1 introduced bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=501000 so this task ensures that we install Neon.0 to avoid that problem.</description>
</setup:RedirectionTask>
Right click on the root User object in the Setup editor, Paste this into your user.setup, and save. The installer will then redirect access to the Neon.1 repository to use the Neon.0 repository instead.
Hopefully there will be a build with the fix for this bug soon, and then we'll be able to use the same approach to replace the redirection task with a p2 task that points at the build with the fix so we can install Neon.1, but with the fixed version of MPC. (Or I'll be able to change the generated product catalog to add that update site so that you'll be able to delete the redirection task.)
You can follow the Bugzilla for developing details regarding the approach for addressing this problem.
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05748 seconds