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

The formatter doesn't seem to use the VSCode proxy for downloading xsd files #735

Closed
halloleo opened this issue Jul 13, 2022 · 13 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@halloleo
Copy link

When the extension formats a pom.xml (which contains an XML Schema) VS Code issues the problem "Error while downloading 'http://maven.apache.org/xsd/maven-4.0.0.xsd'...".

I have defined a proxy in VS Code's settings, but I assume the extension does not obey/use this proxy.

Is there another way to tell the formatter to use a proxy?

@fbricon
Copy link
Collaborator

fbricon commented Jul 13, 2022

@halloleo
Copy link
Author

Thanks @fbricon !

I have set http.proxy in vscode's settings. I don't need authorisation.

I left http.proxySupport alone, showing "override" in the dialog.

This is from my understanding exactly what the page you link to says - but it doesn't work.

PS: On the page is the strange sentence: "If you set [http.proxySupport] to override, VS Code will attempt to rewrite the requests from extensions to go through the proxy that is configured for VS Code. However, this method sometimes does not work correctly." - In my case it doesn't seem to work correctly indeed, so what can I do?

@fbricon
Copy link
Collaborator

fbricon commented Jul 13, 2022

@datho7561 can you please investigate?

@datho7561 datho7561 self-assigned this Jul 13, 2022
@datho7561
Copy link
Contributor

Hello! I've tried on my machine with this proxy, and everything appears to be working.

Which version of the extension are you using? Which version of VS Code (/Codium/Theia/?) are you using?

One thing that might be related is that http://maven.apache.org/xsd/maven-4.0.0.xsd redirects to the https version of the website; maybe something goes wrong when trying to handle this redirect? I'll research some more.

@halloleo
Copy link
Author

Thanks for chiming in, @datho7561!

I use VS Code from the Microsoft RPM. The machine is a RHEL 8 Linux box on a corporate network.

The proxy software is px-proxy on a RHEL 7 box. The redirect might be the problem for the proxy. I'll test this outside VS Code soon.

@halloleo
Copy link
Author

Just FYI: When I do

wget http://maven.apache.org/xsd/maven-4.0.0.xsd

with the px-proxy entered in my .wgetrc, hen I can download the schema without problems.

@datho7561
Copy link
Contributor

Okay. I'll investigate some more today. Likely my proxy setup was allowing traffic to bypass the proxy

@datho7561
Copy link
Contributor

I was able to get a proper setup where my machine needs to use the proxy to access the http/https, and I am able to reproduce the issue.

@datho7561
Copy link
Contributor

I figured out the issue and am working on the PR. In the mean time, here is a workaround: https://github.com/redhat-developer/vscode-xml/blob/master/docs/Preferences.md#server-vm-arguments. My PR will just make sure that these parameters are set for you if you have set http.proxy in the VS Code settings.

datho7561 added a commit to datho7561/vscode-xml that referenced this issue Jul 14, 2022
One part of redhat-developer#735

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 added the bug Something isn't working label Jul 14, 2022
datho7561 added a commit to datho7561/vscode-xml that referenced this issue Jul 14, 2022
One part of redhat-developer#735

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-xml that referenced this issue Jul 14, 2022
One part of redhat-developer#735

Signed-off-by: David Thompson <davthomp@redhat.com>
@halloleo
Copy link
Author

Thanks that you looked into this! :)

datho7561 added a commit that referenced this issue Jul 15, 2022
One part of #735

Signed-off-by: David Thompson <davthomp@redhat.com>
@angelozerr
Copy link
Contributor

@datho7561 @halloleo is it this issue fixed?

@datho7561
Copy link
Contributor

@angelozerr It should be fixed in the prereleases, but we haven't released since then

@angelozerr
Copy link
Contributor

@datho7561 I think we can close this issue no?

@datho7561 datho7561 added this to the 0.22.0 milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants