Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Unauthorized 401 when trying to clone
Unauthorized 401 when trying to clone [message #1744691] Thu, 29 September 2016 13:58 Go to next message
Jesper Skov is currently offline Jesper SkovFriend
Messages: 4
Registered: January 2012
Junior Member
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 #1744729 is a reply to message #1744691] Thu, 29 September 2016 17:38 Go to previous messageGo to next message
Christian Saad is currently offline Christian SaadFriend
Messages: 39
Registered: July 2009
Member
I experience exactly the same issue with Neon SR1. Trying to clone over https, I get a list of branches but the subsequent clone operation fails with 401.
Re: Unauthorized 401 when trying to clone [message #1744736 is a reply to message #1744729] Thu, 29 September 2016 18:19 Go to previous messageGo to next message
Michael Relby is currently offline Michael RelbyFriend
Messages: 4
Registered: November 2013
Junior Member
Same here, on Bitbucket and own local git server, push fails with 401 Unauthorized after an upgrade to 4.6.1 (and even after p2 revert to 4.6.0)
Re: Unauthorized 401 when trying to clone [message #1744755 is a reply to message #1744736] Fri, 30 September 2016 04:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 28450
Registered: July 2009
Senior Member
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.
Re: Unauthorized 401 when trying to clone [message #1744781 is a reply to message #1744755] Fri, 30 September 2016 08:07 Go to previous messageGo to next message
Jesper Skov is currently offline Jesper SkovFriend
Messages: 4
Registered: January 2012
Junior Member
A fix has been posted to the issue:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=501000

This fixes the problem for me.
Re: Unauthorized 401 when trying to clone [message #1744982 is a reply to message #1744781] Mon, 03 October 2016 18:54 Go to previous messageGo to next message
Ari Meyer is currently offline Ari MeyerFriend
Messages: 12
Registered: July 2016
Junior Member
Thanks for the link, Jesper and Ed -- big help! I'll just summarize the current workaround for others baffled by this one:

Help -> Install New Software
Work with: http://download.eclipse.org/mpc/releases/1.5.1a
Select the "EPP Marketplace Client"
Proceed with defaults

HTH!
Re: Unauthorized 401 when trying to clone [message #1745266 is a reply to message #1744982] Fri, 07 October 2016 07:03 Go to previous messageGo to next message
Dominic Cerisano is currently offline Dominic CerisanoFriend
Messages: 2
Registered: October 2016
Junior Member
Do not do anything anyone recommended on this thread - it won't work and just gets neoninto a misaligned state.
The best way to proceed is to just hit "cancel" when neon asks for authorization.
Keep checking the software updates for a neon upgrade.
I did not think that the eGit workflow could get any worse - what a joke.
Re: Unauthorized 401 when trying to clone [message #1745367 is a reply to message #1744982] Sat, 08 October 2016 16:30 Go to previous messageGo to next message
Chuck Mosher is currently offline Chuck MosherFriend
Messages: 1
Registered: October 2016
Junior Member
Thanks all - and to Ari for posting the summary.

Worked like a charm, and fixed the issue for me as well.

Best regards,
Chuck Mosher
JavaSeis.org
Re: Unauthorized 401 when trying to clone [message #1745406 is a reply to message #1744982] Mon, 10 October 2016 11:54 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 192
Registered: July 2009
Senior Member
My workaround: In dialog box asking for credentials, I pressed cancel. Then the correct dialog box would pop up and I could continue.
Re: Unauthorized 401 when trying to clone [message #1761424 is a reply to message #1745406] Wed, 10 May 2017 22:27 Go to previous message
Kevin Netherton is currently offline Kevin NethertonFriend
Messages: 1
Registered: May 2017
Junior Member
I'm using eclipse Neon 3 (4.6.3) Build id 20170314-1500. I have run update an am 100% up to date. Looks like its using the marketplace client version 1.5.4.v20170222-1941.

I continue to be unable to push my git commits using https authentication. Still returns the following:

Can't connect to any repository: https://blah blah blah: 401 Unauthorized). I am able push no problem using command line. I've tried every suggestion I can find on the internet with respect to how to resolve this issue, including the various references to patching the marketplace client etc. None of these attempts have resulted in a resolution. Any suggestions would be welcomed. Anyone know if this bug will be fixed in the Oxygene release.

Thanks

Previous Topic:egit shows ">" on all files in newly cloned project
Next Topic:slowness in egit after recent upgrade
Goto Forum:
  


Current Time: Sat May 27 17:38:36 GMT 2017

Powered by FUDForum. Page generated in 0.01877 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software