| Summary: | Installation using p2 installer from password protected site fails | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Sonia Dimitrov <sonia_dimitrov> | ||||
| Component: | p2 | Assignee: | P2 Inbox <equinox.p2-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dan, dassarma, john.arthorne, pwebster | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Sonia Dimitrov
Does anyone have an update on this? Will this be considered for a future patch release? 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.
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?
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. |