Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316026 - Installation using p2 installer from password protected site fails
Summary: Installation using p2 installer from password protected site fails
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 12:33 EDT by Sonia Dimitrov CLA
Modified: 2019-09-25 15:36 EDT (History)
4 users (show)

See Also:


Attachments
Potential patch (1.96 KB, patch)
2010-12-03 18:17 EST, Daniel Jacobowitz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sonia Dimitrov CLA 2010-06-07 12:33:05 EDT
Installation using the p2 installer for both 3.5.2 and latest from 3.6 fails with 
"!MESSAGE Authentication failed for http://jazzweb.beaverton.ibm.com/rtc/main/I/RTC-I20100604-1245/full-rtc-client-zips/output/native/repo."

Here are contents of the installer.properties:

eclipse.p2.metadata=http://jazzweb.beaverton.ibm.com/rtc/main/I/RTC-I20100604-1245/full-rtc-client-zips/output/native/repo
eclipse.p2.artifacts=http://jazzweb.beaverton.ibm.com/rtc/main/I/RTC-I20100604-1245/full-rtc-client-zips/output/native/repo
eclipse.p2.flavor=tooling
eclipse.p2.profileName=RTC Client
eclipse.p2.launcherName=eclipse
eclipse.p2.rootId=com.ibm.team.concert.uuid
eclipse.p2.autoStart=true
org.eclipse.update.install.features=true

I am able to install from the same site using the eclipse platform runtime(3.5.2), I get prompted for credentials.
Comment 1 dassarma CLA 2010-07-13 15:42:58 EDT
Does anyone have an update on this? Will this be considered for a future patch release?
Comment 2 Daniel Jacobowitz CLA 2010-11-27 19:30:37 EST
I've been looking at a bug that I think is the same problem.

In Credentials.java:

							//null result means user canceled password dialog
							if (DebugHelper.DEBUG_REPOSITORY_CREDENTIALS) {
								if (loginDetails == null)
									DebugHelper.debug("Credentials", "forLocation:PROMPTED - USER CANCELED (PROMPT LOCK RELEASED)", // //$NON-NLS-1$ //$NON-NLS-2$
											new Object[] {"host", location}); //$NON-NLS-1$					
							}
							if (loginDetails == null) {
								rememberCancel(host);
								throw new LoginCanceledException();
							}

But in ValidationDialogServiceUI.java:

		final AuthenticationInfo[] result = new AuthenticationInfo[1];
		if (!suppressAuthentication() && !isHeadless()) {
...
		}
		return result[0];

So it returns null if suppressAuthentication, i.e. when preloading repositories.  Then the site is marked as cancelled.

This didn't happen for me in 3.5.0, but does almost every time in 3.6.  That may have to do with how long other non-password-protected sites take to preload.

To reproduce, install Eclipse 3.6.  Go into Window -> Preferences -> Install/Update -> Available Software Sites.  Click Add, and add this:

  http://nan.false.org/~drow/protected

There's nothing there, it's just an empty password-protected directory.  Click OK until you're out of the preferences dialogs.

Now, don't do this next bit; it's just for explanation.  If, at this point, I go into Help -> Install New Software and select the site in a reasonably brisk way, I get a password prompt.  Clicking Cancel gets me a dialog that just says "ProvisionException" and "Authentication failed" - not very user-friendly, but, OK.  At this point, instead of prompting again, selecting the site just gives me the exception again.  It looks like this is on purpose, but IMO it's bad design to cache the cancellation this long.  I haven't verified what's going on there.

Back to my example now.  Go into the preferences again.  Clear the check boxes next to any other update sites you have configured.  Now go into Help -> Install New Software.  Wait until .metadata/.log shows an Authentication Failed message for the new site.  Select it.  Instead of a password dialog, you get a ProvisionException message box.

The site has been marked as cancelled even though the only thing "cancelled" was displaying a dialog box during preloading.
Comment 3 Daniel Jacobowitz CLA 2010-12-03 18:17:43 EST
Created attachment 184522 [details]
Potential patch

Here's a fix that works for my purposes.  However, the SUPPRESS_AUTHENTICATION_JOB_MARKER business is the spirit of an API problem; it implies that something should be exposed in API that isn't.

A better solution would be a way to request credentials with a flag that says "do not interact with the user".  We could also use that to not log ugly authentication errors to the log file when preloading.

Comments?
Comment 4 Eclipse Genie CLA 2019-09-25 15:36:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.