Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading external schemas #134

Closed
stodge opened this issue Apr 30, 2019 · 15 comments
Closed

Error downloading external schemas #134

stodge opened this issue Apr 30, 2019 · 15 comments

Comments

@stodge
Copy link

stodge commented Apr 30, 2019

I keep getting an occasional error when vscode xml is trying to download external schemas:

Error while downloading 'http://www.w3.org/2001/xml.xsd' to /home/mike/.lsp4xml/cache/http/www.w3.org/2001/xml.xsd.

I've no doubt that our company networking could be at fault, but is there an easy way to force vscode to retry downloading an individual schema? If I delete the local cache under ~/.lsp4xml and restart vscode, it will re-download them. However, I'll often hit the same problem again.

Thanks

@fbricon
Copy link
Collaborator

fbricon commented Apr 30, 2019

are you behind a proxy server?

@fbricon
Copy link
Collaborator

fbricon commented Apr 30, 2019

If behind a corporate proxy, you could try to add proxy settings to the xml.server.vmargs preference:

"xml.server.vmargs": "-noverify -Xmx64M -XX:+UseG1GC -XX:+UseStringDeduplication -Dhttp.proxyHost=webproxy.corp.net -Dhttp.proxyPort=proxyport -Dhttp.proxyUser=user -Dhttp.proxyPassword=password -Dhttps.proxyHost=webproxy.corp.net -Dhttps.proxyPort=proxyport -Dhttps.proxyUser=user -Dhttps.proxyPassword=password"

@stodge
Copy link
Author

stodge commented May 6, 2019

Thanks. I don't know if I am behind a proxy. I assume so, but I never configure anything else to connect to the internet.

@NikolasKomonen
Copy link
Contributor

@stodge

Maybe if your work system was previously configured try the flag from :
https://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm#answer-11527488

where you would add in the flag -Djava.net.useSystemProxies=true into the xml.server.vmargs preference.

@angelozerr
Copy link
Contributor

I close this issue since we have no answer. @stodge please reopen it if you need it.

@ilyakanevsky
Copy link

I'm behind McAfee Web Gateway proxy with NTLMv2 auth.

The flag -Djava.net.useSystemProxies=true isn't working for me.

But combination of -Dhttp.proxyHost=webproxy.corp.net -Dhttp.proxyPort=proxyport -Dhttp.proxyUser=user -Dhttp.proxyPassword=password -Dhttps.proxyHost=webproxy.corp.net -Dhttps.proxyPort=proxyport -Dhttps.proxyUser=user -Dhttps.proxyPassword=password works well. It doesn't depend on setting user as -Dhttps.proxyUser=user or -Dhttps.proxyUser=DOMAIN\\user.

It works in versions: 0.9, 0.9.1, 0.11.0 (see most recent build on https://download.jboss.org/jbosstools/vscode-xml/staging/?C=M;O=D).

@nicolefinnie
Copy link

For people who don't know where xml.server.vmargs should be set in vscode, it's likely to be placed under ~/.config/Code/User/settings.json on Linux. And the proxy host, the user name, and the encrypted password should be the same as ~/.m2/settings.xml. You store your encrypted master password here ~/.m2/settings-security.xml. You should have set it up otherwise mvn wouldn't be able to get through the proxy either.

You can find the official maven page to encrypt your master password and proxy password.

@IssaBa
Copy link

IssaBa commented Nov 18, 2020

Hello ,
I managed to make this error disappear by putting https instead of http on the urls of maven instances:
<project xmlns="### https://maven.apache.org/POM/4.0.0" xmlns:xsi="### https://www.w3.org/2001/XMLSchema-instance"
Thanks

@Talv
Copy link

Talv commented Dec 29, 2020

I experience the same issue, and I'm NOT behind a proxy.

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
</doctrine-mapping>

the log says:

[Trace - 9:45:49 AM] Received notification 'window/logMessage'.
Params: {
    "type": 1,
    "message": "Dec 29, 2020 09:45:49 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()\nMessage: Error while downloading https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd to /home/kk/.lemminx/cache/https/www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd : [java.io.IOException] Server returned HTTP response code: 403 for URL: https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
}


[Error - 9:45:49 AM] Dec 29, 2020 09:45:49 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()
Message: Error while downloading https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd to /home/kk/.lemminx/cache/https/www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd : [java.io.IOException] Server returned HTTP response code: 403 for URL: https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd

Server returned HTTP response code: 403 for URL: https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd

This doesn't appear to be true.

Performing HEAD requests on that URL via curl returns 200: (GET works as well).

$ curl --head https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd
HTTP/2 200
date: Tue, 29 Dec 2020 08:58:05 GMT
content-type: application/xml

The suggested workaround posted by @IssaBa works (changing http to https), but it doesn't explain the problem and is not a fix. I think this should be re-opened @angelozerr .

@mwisnicki
Copy link

@Talv where do you see these logs? I tried extension host logs but it doesn't have anything

@mwisnicki
Copy link

OK I found them in the logging folder.
I'm getting Connection refused: connect despite having all the proxy flags set.
The url from logs looks fine and can be downloaded with curl.

@mwisnicki
Copy link

The only workaround I could find is to download it manually and place in the xsd cache directory :(

@angelozerr
Copy link
Contributor

@mwisnicki could you give us the xml which références the xsd which czn be downloaded please

@mwisnicki
Copy link

It's a standard Maven POM: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html#the-pom
Note that you might need to change schema location to https because apparently vscode-xml has trouble following redirects.

@angelozerr
Copy link
Contributor

I will investigate the htpps redirect problem.

Please note that we would like to provide default catalog with this maven xsd.

See eclipse-lemminx/lemminx#1182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants