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

Plugin does not use eclipse proxy settings #1101

Closed
parenko opened this issue Aug 23, 2023 · 8 comments
Closed

Plugin does not use eclipse proxy settings #1101

parenko opened this issue Aug 23, 2023 · 8 comments
Assignees
Labels
for: eclipse something that is specific for Eclipse type: bug

Comments

@parenko
Copy link

parenko commented Aug 23, 2023

Describe the bug
I am getting following Exception that https://api.spring.io/projects could not be reached.
Direct connection is forbidden on my corporate machine.
Eclipse is configured to use Proxy, but STS4 does not use thise settings.

To Reproduce
Configure Eclipse to use Proxy.
(Disable direct access to the internet. Allow connection only over a proxy.)
Start Eclipse with STS4 Plugin.
After some time Spring Boot Language Server logs the problem.

Sample

15:44:24.843 [Project-Reconciler-1] ERROR o.s.i.v.b.v.g.ProjectVersionDiagnosticProvider - 
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://api.spring.io/projects": Connection timed out: connect
	at org.springframework.web.client.RestTemplate.createResourceAccessException(RestTemplate.java:888)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:868)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:764)
	at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:646)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.get(SpringProjectsClient.java:74)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.fromEmbedded(SpringProjectsClient.java:53)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.getSpringProjects(SpringProjectsClient.java:40)
	at org.springframework.ide.vscode.boot.validation.generations.SpringIoProjectsProvider.cache(SpringIoProjectsProvider.java:60)
	at org.springframework.ide.vscode.boot.validation.generations.SpringIoProjectsProvider.getProject(SpringIoProjectsProvider.java:54)
	at org.springframework.ide.vscode.boot.validation.generations.GenerationsValidator.validate(GenerationsValidator.java:57)
	at org.springframework.ide.vscode.boot.validation.generations.ProjectVersionDiagnosticProvider.getDiagnostics(ProjectVersionDiagnosticProvider.java:56)
	at org.springframework.ide.vscode.boot.validation.BootVersionValidationEngine.reconcile(BootVersionValidationEngine.java:50)
	at org.springframework.ide.vscode.boot.common.ProjectReconcileScheduler.lambda$scheduleValidation$0(ProjectReconcileScheduler.java:85)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at org.springframework.ide.vscode.boot.common.ProjectReconcileScheduler.lambda$scheduleValidation$1(ProjectReconcileScheduler.java:83)
	at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:171)
	at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539)
	at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run(MonoPublishOn.java:181)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
	at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:579)
	at java.base/sun.nio.ch.Net.connect(Net.java:568)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
	at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:174)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
	at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
	at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
	at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:75)
	at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
	at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:862)
	... 23 common frames omitted
@parenko parenko changed the title Public website could not be reached behind a proxy Plugin does not use eclipse proxy settings Aug 24, 2023
@martinlippert martinlippert added this to the 4.20.0.RELEASE milestone Aug 28, 2023
@martinlippert martinlippert added status: needs-investigation for: eclipse something that is specific for Eclipse and removed status: waiting-for-triage labels Aug 28, 2023
@BoykoAlex
Copy link
Contributor

BoykoAlex commented Sep 6, 2023

@parenko what kind of a proxy is it? Does it require authentication? I suspect that everything requiring authentication would be problematic... username/password in VSCode is stored somewhere in electron proxy auth which i have no idea how to get to yet. Furthermore, looks like VSCode asks for username/password on demand which may happen later than Spring Boot LS first reconciling cycle...
Anyway, I think I can support username/password auth for the Eclipse case for now... I'd probably push this right after 4.20 release to try this out for you in a snapshot build. What do you think?

@martinlippert I had to add okhttp to support authenticated proxy case. Wonder if it is okay... or perhaps just support proxies not requiring authentication to simplify things for now?

@parenko
Copy link
Author

parenko commented Sep 7, 2023

@BoykoAlex our proxy requires authentication.
I would support you and try a snapshot :)

@BoykoAlex
Copy link
Contributor

Cool, a 4.20.1 snapshot next week then.

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Sep 13, 2023

@parenko Lets give the fix d7ae292 a try. Please have look at the snapshot build page and pick either a distro build or an update site: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html

Eclipse STS4 should have proxy support with authentication, VSCode without the authentication

@parenko
Copy link
Author

parenko commented Sep 14, 2023

@BoykoAlex Just updated to 4.20.1.202309132024 (see below). After restart there were no exceptions in log anymore.
When I switch proxy off (Active Provider: Direct), then, as expected, there are exceptions like one above.

I have following Plugins:

  • Spring Boot Language Server Feature 4.20.1.202309132019
  • Spring IDE Boot Microservices Dash 4.20.1.202309132024
  • Spring Tool Suite 4 Main Feature 4.20.1.202309132024
    • Spring XML Namespace Support 4.20.1.202309132024

@BoykoAlex
Copy link
Contributor

Sounds like the fix for http proxy is working, right?

@parenko
Copy link
Author

parenko commented Sep 15, 2023

Yes I would say so.
Could you please tell me where I can find the results of this successful execution?

If this fix also have something to do with the dialog "New Spring Starter Project", then the fix works.
With proxy configs enabled, then the dialog shows content.
Without proxy, the dialog displays an error:
image

I think the fix works as intended.

@lfvJonas
Copy link

lfvJonas commented Nov 17, 2023

Will this fix the issue for use in VS code as well? Having the same issue in VS code and I use version 4.20.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse type: bug
Projects
None yet
Development

No branches or pull requests

4 participants