Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Unauthorized 401 when trying to clone
Unauthorized 401 when trying to clone [message #1744691] Thu, 29 September 2016 09:58 Go to next message
Eclipse UserFriend
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 13:38 Go to previous messageGo to next message
Eclipse UserFriend
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 14:19 Go to previous messageGo to next message
Eclipse UserFriend
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 00:21 Go to previous messageGo to next message
Eclipse UserFriend
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 04:07 Go to previous messageGo to next message
Eclipse UserFriend
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 14:54 Go to previous messageGo to next message
Eclipse UserFriend
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 03:03 Go to previous messageGo to next message
Eclipse UserFriend
The best way to proceed is to just hit "cancel" when neon asks for authorization.
Also try clearing your secure store cache and deleting old git keys.
Keep checking the software updates for a neon upgrade.

[Updated on: Fri, 14 July 2017 14:59] by Moderator

Re: Unauthorized 401 when trying to clone [message #1745367 is a reply to message #1744982] Sat, 08 October 2016 12:30 Go to previous messageGo to next message
Eclipse UserFriend
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 07:54 Go to previous messageGo to next message
Eclipse UserFriend
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 18:27 Go to previous messageGo to next message
Eclipse UserFriend
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

Re: Unauthorized 401 when trying to clone [message #1792456 is a reply to message #1744982] Wed, 18 July 2018 05:31 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Ari for posting the summary.

Fixed the issue for me as well.
Re: Unauthorized 401 when trying to clone [message #1792507 is a reply to message #1792456] Wed, 18 July 2018 14:34 Go to previous message
Eclipse UserFriend
Glad it helped!
Previous Topic:Clone to streams?
Next Topic:Git hooks not working
Goto Forum:
  


Current Time: Mon Jun 09 05:04:27 EDT 2025

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

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

Back to the top