Skip to content

VS Code extension does not use proxy settings #1147

@lfvJonas

Description

@lfvJonas

Describe the bug
We use a company proxy and the Spring Language Server is unable to reach external resources. On the same device it is possible to curl the same resource from the terminal.

Issue relates to #1101 and #498

I expect that it's the same issue as the first one since we get the same logs. But in that issue only a fix is made for Eclipse and not VSCode.

VSCode gets its proxy settings from the enviroment varibles http_proxy and https_proxy.

To Reproduce
(Ubuntu 22.04.3 LTS, VSCode 1.84.2, Spring Boot Tools v1.50.0)

  1. Use proxy with authentication
  2. Set enviroment varibles http_proxy and https_proxy
  3. Start up VSCode
  4. Get these errorlog in vscode-spring-boot-debug-log output after about 60 secs
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:52 AM] Client vscode-spring-boot: connection to server is erroring. Shutting down server.
[Error - 8:44:54 AM] Stopping server timed out
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23
[Error - 8:44:54 AM] Stopping server failed
Error: Stopping the server timed out
	at /home/u70565/.vscode/extensions/vmware.vscode-spring-boot-1.50.0/node_modules/vscode-languageclient/lib/common/client.js:933:23

and when I log to file I get theses:

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://api.spring.io/projects": Network is unreachable
	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:804)
	at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:665)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.get(SpringProjectsClient.java:79)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.fromEmbedded(SpringProjectsClient.java:57)
	at org.springframework.ide.vscode.boot.validation.generations.SpringProjectsClient.getSpringProjects(SpringProjectsClient.java:44)
	at org.springframework.ide.vscode.boot.validation.generations.SpringIoProjectsProvider.cache(SpringIoProjectsProvider.java:84)
	at org.springframework.ide.vscode.boot.validation.generations.SpringIoProjectsProvider.getProject(SpringIoProjectsProvider.java:75)
	at org.springframework.ide.vscode.boot.validation.generations.UpdateBootVersion.validate(UpdateBootVersion.java:49)
	at org.springframework.ide.vscode.boot.validation.generations.ProjectVersionDiagnosticProvider.getDiagnostics(ProjectVersionDiagnosticProvider.java:60)
	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(Unknown Source)
	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(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Network is unreachable
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Unknown Source)
	at java.base/sun.nio.ch.Net.connect(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.connect(Unknown Source)
	at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
	at java.base/java.net.Socket.connect(Unknown Source)
	at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:128)
	at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
	at org.springframework.http.client.OkHttp3ClientHttpRequest.executeInternal(OkHttp3ClientHttpRequest.java:68)
	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
	Suppressed: java.net.SocketTimeoutException: Connect timed out
		at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source)
		... 47 common frames omitted
	Suppressed: java.net.SocketTimeoutException: Connect timed out
		at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source)
		... 47 common frames omitted
	Suppressed: java.net.SocketException: Network is unreachable
		... 50 common frames omitted

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions