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

XSD download fails in recent versions #226

Closed
SebastianPfliegel opened this issue Feb 25, 2020 · 15 comments · Fixed by #229
Closed

XSD download fails in recent versions #226

SebastianPfliegel opened this issue Feb 25, 2020 · 15 comments · Fixed by #229
Assignees
Labels
bug Something isn't working regression
Milestone

Comments

@SebastianPfliegel
Copy link

I noticed that this extension no longer downloads external schemas for me. I'm behind a corporate proxy.

This is part of my settings.json:
"xml.server.vmargs": "-Dhttp.proxyHost=PROXYHOST -Dhttp.proxyPort=3128 -Dhttps.proxyHost=PROXYHOST -Dhttps.proxyPort=3128"

The last working extension version is 0.9.1 (downgrading does the trick for me). 0.10.0 and 0.10.1 are broken for me.

This is the error I get:

{
	"resource": "/c:/Users/pfliegel.sebastian/Projects/MDS/src/main/db/tables/changelog_20200220.xml",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "Error while downloading 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd' to C:\\Users\\pfliegel.sebastian\\.lsp4xml\\cache\\http\\www.liquibase.org\\xml\\ns\\dbchangelog\\dbchangelog-3.8.xsd.",
	"source": "XML",
	"startLineNumber": 3,
	"startColumn": 2,
	"endLineNumber": 3,
	"endColumn": 19
}

This issue is similar to #134, but I assume only the proxy settings were missing (as only more recent versions are affected by this bug).

@angelozerr
Copy link
Contributor

@fbricon have you an idea about that?

@ilyakanevsky
Copy link

I have the same problem with the actual 0.10.1 version.

@SebastianPfliegel
Copy link
Author

@ilyakanevsky downgrading to 0.9.1 fixes the problem for you, too?

@fbricon
Copy link
Collaborator

fbricon commented Mar 6, 2020

did you set your proxy settings in the user's settings.json or the current directory?

@SebastianPfliegel
Copy link
Author

Hey @fbricon, I modified the user´s settings.json.

@fbricon
Copy link
Collaborator

fbricon commented Mar 6, 2020

Ok so it's not dc03e74#diff-d106f0e1914f2f6cbf79404a7f0c42b4 then. Maybe @snjeza can help troubleshooting proxy issues

@ilyakanevsky
Copy link

My settings:
"xml.java.home": "C:\\Program Files\\Java\\jre1.8.0_231",
"xml.server.vmargs": "-Djava.net.useSystemProxies=false -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3130 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3130",

Now I use https://github.com/genotrance/px for proxy between applications and the real proxy. So I can see connections (initiated by each application) in the log.

@ilyakanevsky downgrading to 0.9.1 fixes the problem for you, too?

I've just tried and answer is "Yes".

(But it downloads file %USERPROFILE%.lsp4xml\cache\http\www.w3.org\2001\XMLSchema incorrectly, and after that cannot download some resources for rddl folder:
Error while downloading 'http://www.w3.org/2001/rddl/xhtml-inlstruct-1.mod' to %USERPROFILE%\.lsp4xml\cache\http\www.w3.org\2001\rddl\xhtml-inlstruct-1.mod.
Error while downloading 'http://www.w3.org/2001/rddl/xhtml-blkphras-1.mod' to %USERPROFILE%\.lsp4xml\cache\http\www.w3.org\2001\rddl\xhtml-blkphras-1.mod.
Error while downloading 'http://www.w3.org/2001/rddl/xhtml-hypertext-1.mod' to %USERPROFILE%\.lsp4xml\cache\http\www.w3.org\2001\rddl\xhtml-hypertext-1.mod.
)

If I use 0.10.0 or most recent vscode-xml-0.11.0-4168.vsix, there are no connections at all! This is definitely a bug.

@ilyakanevsky
Copy link

ilyakanevsky commented Mar 12, 2020

Ok so it's not dc03e74#diff-d106f0e1914f2f6cbf79404a7f0c42b4 then.

I guess it is. Maybe the root of a problem is here: IS_WORKSPACE_VMARGS_XML_ALLOWED.

@snjeza, we need your help.

@snjeza snjeza self-assigned this Mar 13, 2020
@fbricon fbricon added this to the 0.11.0 milestone Mar 13, 2020
@fbricon fbricon added bug Something isn't working regression labels Mar 13, 2020
@SebastianPfliegel
Copy link
Author

I tested the most recent CI build (https://download.jboss.org/jbosstools/vscode-xml/staging/vscode-xml-0.11.0-4173.vsix)

I can confirm that it is working again. Thanks!

@angelozerr
Copy link
Contributor

I can confirm that it is working again. Thanks!

Great! Thanks @SebastianPfliegel for your feedback.

Thanks @snjeza for your fix!

@ilyakanevsky
Copy link

ilyakanevsky commented Mar 17, 2020

I can confirm that it is working again. Thanks!

I confirm too. Thanks for quick fix.

But it downloads file %USERPROFILE%.lsp4xml\cache\http\www.w3.org\2001\XMLSchema incorrectly

This problem is still here. Fix: download manually http://www.w3.org/2001/XMLSchema.xsd and save it as %USERPROFILE%.lsp4xml\cache\http\www.w3.org\2001\XMLSchema (without extension).

P.S. I add manually this string:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/"
in *.wsdl files to validate them against XSD for XML and XSD for WSDL.

@SebastianPfliegel
Copy link
Author

@ilyakanevsky the extension uses a new directory:
%USERPROFILE%\.lemminx\cache\

@angelozerr
Copy link
Contributor

angelozerr commented Mar 17, 2020

But it downloads file %USERPROFILE%.lsp4xml\cache\http\www.w3.org\2001\XMLSchema incorrectly,

We try and guess the best path where XML Schema/DTD must be downloaded to improve drasticly the performance in https://github.com/eclipse/lemminx/blob/9a4ef41513283d057581b743107e03115dae8434/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/FilesUtils.java#L98

If anybody have some idea how to fix that, any idea are welcome!

But you can customize this folder (if you have this kind problem) with the xml.server.workDir. I suggest you to do that.

@ilyakanevsky the extension uses a new directory: %USERPROFILE%.lemminx\cache\

Indeed my lsp4xml project has been moved to Eclipse.org and the new name is ....

Let's go for LemMinX!

Hope you will like it.

@ilyakanevsky
Copy link

ilyakanevsky commented Mar 20, 2020

@ilyakanevsky the extension uses a new directory:
%USERPROFILE%\.lemminx\cache\

Yes, I've seen it.

But you can customize this folder (if you have this kind problem) with the xml.server.workDir. I suggest you to do that.

Yes, I've done it:
"xml.server.workDir": "~/.lsp4xml",

@ilyakanevsky
Copy link

We try and guess the best path where XML Schema/DTD must be downloaded

The problem I told above isn't about the path on the disk. It's about the URL. Correct URL for namespace http://www.w3.org/2001/XMLSchema is not http://www.w3.org/2001/XMLSchema but http://www.w3.org/2001/XMLSchema.xsd. It isn't related to current issue. Also it isn't a bug of plugin. But it will be great if plugin will have a fix for it and make a hidden redirect from http://www.w3.org/2001/XMLSchema to http://www.w3.org/2001/XMLSchema.xsd, transparent for user.
P.S. For other popular namespaces their names are the correct URLs. E.g.:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants