Bug 493014 - [Proxy] Eclipse Neon 4.6 error trying to access Marketplace using proxy.
Summary: [Proxy] Eclipse Neon 4.6 error trying to access Marketplace using proxy.
Status: NEW
Alias: None
Product: MPC
Classification: Technology
Component: wizard (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 496968 499383 500983 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-04 12:53 EDT by Diogo Reis CLA
Modified: 2018-08-03 03:27 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diogo Reis CLA 2016-05-04 12:53:30 EDT
Eclipse Neon 4.6 error trying to access Marketplace using proxy.

After applying my proxy config at Window -> Preferences -> General -> Network Configuration (which works fine on Eclipse Luna 4.4.1)

File org.eclipse.core.net.prefs:

eclipse.preferences.version=1
org.eclipse.core.net.hasMigrated=true
proxyData/HTTP/hasAuth=true
proxyData/HTTP/host= <ommited>
proxyData/HTTP/port=8080
proxyData/HTTPS/hasAuth=true
proxyData/HTTPS/host= <ommited>
proxyData/HTTPS/port=8080
systemProxiesEnabled=false

========================================================

I receive the following error trying to access Help -> Eclipse Marketplace option:

Cannot open Eclipse Marketplace
Cannot install remote marketplace locations: Cannot complete request to http://marketplace.eclipse.org/catalogs/api/p: Invalid response content: White spaces are required between publicId and systemId.
Cannot complete request to http://marketplace.eclipse.org/catalogs/api/p: Invalid response content: White spaces are required between publicId and systemId.
Invalid response content: White spaces are required between publicId and systemId.
White spaces are required between publicId and systemId.
Received response begins with:

1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2: <HTML><HEAD><TITLE>Error Message</TITLE>
3: <META http-equiv=Content-Type content="text/html; charset=UTF-8">

Cannot complete request to http://marketplace.eclipse.org/catalogs/api/p: Invalid response content: White spaces are required between publicId and systemId.
Invalid response content: White spaces are required between publicId and systemId.
White spaces are required between publicId and systemId.
Received response begins with:

1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2: <HTML><HEAD><TITLE>Error Message</TITLE>
3: <META http-equiv=Content-Type content="text/html; charset=UTF-8">




========================================================================

Exception at Eclipse log:

org.eclipse.core.runtime.CoreException: Cannot complete request to http://marketplace.eclipse.org/catalogs/api/p: Invalid response content: White spaces are required between publicId and systemId.
	at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:171)
	at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:101)
	at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:88)
	at org.eclipse.epp.internal.mpc.core.service.DefaultCatalogService.listCatalogs(DefaultCatalogService.java:50)
	at org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand$5.run(MarketplaceWizardCommand.java:278)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:118)
Caused by: org.eclipse.epp.mpc.core.service.UnmarshalException: Invalid response content: White spaces are required between publicId and systemId.
	at org.eclipse.epp.internal.mpc.core.service.MarketplaceUnmarshaller.unmarshal(MarketplaceUnmarshaller.java:61)
	at org.eclipse.epp.internal.mpc.core.service.RemoteMarketplaceService.processRequest(RemoteMarketplaceService.java:141)
	... 5 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and systemId.
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.eclipse.epp.internal.mpc.core.service.MarketplaceUnmarshaller.unmarshal(MarketplaceUnmarshaller.java:57)
	... 6 more
Comment 1 Andrea Scarpino CLA 2016-05-23 05:46:24 EDT
Same issue on Windows 10.
Comment 2 Patrik Suzzi CLA 2016-05-25 06:49:38 EDT
I searched for:
marketplace "White spaces are required between publicId and systemId"

Looking at [#1], seems the issue is caused by the incorrect header. 

In the error message, we read: 
(..)
Received response begins with:

1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2: <HTML><HEAD><TITLE>Error Message</TITLE>
3: <META http-equiv=Content-Type content="text/html; charset=UTF-8">

(..)

IIUC, according #1, the response should begin with: 
1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">


#1 http://stackoverflow.com/questions/16200291/xml-xsd-white-spaces-are-required-between-publicid-and-systemid
Comment 3 Patrik Suzzi CLA 2016-05-25 06:51:38 EDT
Should we move this bug to marketplace, or it is something embedded in Eclipse ?
Comment 4 Patrik Suzzi CLA 2016-06-04 16:33:22 EDT
Looking at Bug 197598 comment 8 , seems we should enter a new bug report against Equinox p2
Comment 5 Patrik Suzzi CLA 2016-06-04 16:36:26 EDT
Please disregard the comment #4, as it is not correct.
Comment 6 Patrik Suzzi CLA 2016-06-30 11:32:56 EDT
Moving to MPC (marketplace). 

This could be a dup of 495989. 
The issue happens after applying proxy config.
Comment 7 Carsten Reckord CLA 2016-07-01 12:12:10 EDT
*** Bug 496968 has been marked as a duplicate of this bug. ***
Comment 8 Carsten Reckord CLA 2016-07-08 11:25:07 EDT
The immediate issue should be fixed with bug 496968. We are using a new transport strategy in Neon, and it is supposed to fall back to the pre-Neon transport in case of an error. Bug 496968 was preventing that.

Additionally, I've added two ways to completely disable the new transport:
(see commit 275bf8e859fd6dfcf7f880893a82cbdff1bff0f5 for details)

1. Using -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4

Since our new transport is also HttpClient-based, I'm going to take this as an indicator to disable it to protect legacy cases.

2. Disabling selected MPC transports with -Dorg.eclipse.epp.mpc.core.service.transport.disabled=<transports>

where <transports> is a comma-separated string of transport service ids. For the new HttpClient transport in Neon, use 
-Dorg.eclipse.epp.mpc.core.service.transport.disabled=org.eclipse.epp.mpc.core.transport.http.wrapper

The fix is available on http://download.eclipse.org/mpc/neon.
Comment 9 Carsten Reckord CLA 2016-07-08 11:31:47 EDT
That said, before closing this, I'd like to find out why our new transport isn't working for you in the first place. 

There were several reasons for MPC to change its transport strategy, chief of which was more direct access to HTTP. But one of those reasons was better support for authenticating proxies - which was a problem in many cases in the past.

My tests did show that it worked much better than the old strategy, even with NTLM proxies, so I'd be eager to learn about your setup:

1. What kind of proxy are you using?
- HTTP or NTLM?
- With authentication?
- Concrete proxy server if you know

If your proxy requires authentication:

2. If you are not using the "native" proxy settings, is your proxy password configured in the proxy properties in Eclipse?

3. Do you get an authentication prompt when trying to connect?
Comment 10 Someone Else CLA 2016-07-11 02:13:47 EDT
Hi Carsten,

thank you very much for the fix :) 

I can now connect to the marketplace using the flag -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4

Without it I get an authentication required error which is consistent with the other features that require internet access.

As for the proxy I've queried our administrator - here's his answer:

"Hello,

we use the Web Security of the Sophos-UTM (formerly Astaro Web Security), it’s not Squid, it’s a proprietary product. It uses NTLM authentication but we can also configure exceptions, especially for FQDNs of software updates if they are statically. The proxy is an private server in our LAN.

I hope this helps you identify the origin of the problem. For private purposes, you can get a three years full license for 50 nodes of the Sophos-UTM and install it including root access. Base is SuSE Linux."

The authentication is tied directly to LDAP.

In Eclipse the network settings are set to native. 

Thanks again for solving the issue!
Comment 11 Carsten Reckord CLA 2016-08-09 13:28:11 EDT
*** Bug 499383 has been marked as a duplicate of this bug. ***
Comment 12 Carsten Reckord CLA 2016-09-07 09:05:46 EDT
*** Bug 500983 has been marked as a duplicate of this bug. ***
Comment 13 Alex Akilov CLA 2017-01-31 11:25:03 EST
This doesn't work with our proxy setup either.  Interestingly, it works with Neon.1 but not Neon.2.  In our case, this isn't a Marketplace issue but a general issue with Neon.2 and Proxy configurations.  I also tried setting -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 but it didn't help.
Comment 14 Carsten Reckord CLA 2017-01-31 11:53:15 EST
Alex, can I assume that you are in a Windows domain and your proxy requires authentication via NTLM or SPNEGO/Kerberos?

I intend to include native support for those available in newer HttpClient versions for MPC in Oxygen (see bug 511226).

(In reply to Alex Akilov from comment #13)
> I also tried setting
> -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.
> provider.filetransfer.httpclient4 but it didn't help.

So this didn't help with e.g. "Help > Install new Software" either? Do you have Eclipse proxy configuration set to "native"?
Comment 15 Davide Cavarretta CLA 2018-08-03 03:27:34 EDT
I have same issue on Photon.
As Alex Akilov said -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4
didn't help out the solution.

I'm in Windows 10 Pro v 10.0.16299.551 with corporate proxy
see bug #537645