Skip to content

Plugin does not use eclipse proxy settings #1101

Closed

Description

@parenko

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

Activity

  1. changed the title [-]Public website could not be reached behind a proxy[/-] [+]Plugin does not use eclipse proxy settings[/+] on Aug 24, 2023
  2. added this to the 4.20.0.RELEASE milestone on Aug 28, 2023
  3. BoykoAlex commented on Sep 6, 2023

    @BoykoAlex
    Contributor

    @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?

  4. parenko commented on Sep 7, 2023

    @parenko
    Author

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

  5. BoykoAlex commented on Sep 7, 2023

    @BoykoAlex
    Contributor

    Cool, a 4.20.1 snapshot next week then.

  6. BoykoAlex commented on Sep 13, 2023

    @BoykoAlex
    Contributor

    @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

  7. parenko commented on Sep 14, 2023

    @parenko
    Author

    @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
  8. BoykoAlex commented on Sep 14, 2023

    @BoykoAlex
    Contributor

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

  9. parenko commented on Sep 15, 2023

    @parenko
    Author

    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.

  10. lfvJonas commented on Nov 17, 2023

    @lfvJonas

    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

Metadata

Metadata

Assignees

Labels

for: eclipsetype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions