zzehring / intellij-jsonnet

An Intellij Plugin for grafana/jsonnet-language-server
Apache License 2.0
14 stars 12 forks source link

Plugin unusable behind HTTP proxy #60

Closed dornimaug closed 1 year ago

dornimaug commented 1 year ago

The plugin cannot be used behind a proxy, because the download of the language server binary fails and there is no workaround (like providing the binary manually at $pluginsPath/Jsonnet Language Server/jsonnet-language-server):

io.ktor.client.network.sockets.ConnectTimeoutException: Connect timeout has expired [url=https://api.github.com/repos/grafana/jsonnet-language-server/releases/latest, connect_timeout=unknown ms]
    at io.ktor.client.plugins.HttpTimeoutKt.ConnectTimeoutException(HttpTimeout.kt:209)
    at io.ktor.client.plugins.HttpTimeoutKt.ConnectTimeoutException$default(HttpTimeout.kt:206)
    at io.ktor.client.engine.cio.Endpoint.getTimeoutException(Endpoint.kt:217)
    at io.ktor.client.engine.cio.Endpoint.connect(Endpoint.kt:206)
    at io.ktor.client.engine.cio.Endpoint.access$connect(Endpoint.kt:23)
    at io.ktor.client.engine.cio.Endpoint$connect$1.invokeSuspend(Endpoint.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:33)
    at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

My proxy is configured manually as described here https://www.jetbrains.com/help/idea/settings-http-proxy.html and it is the first time a plugin has failed for me because of this.

The necessary environment variables (http_proxy, https_proxy, etc.) are also set.

I also tried setting system properties through idea64.vmoptions, which also did not work:

-Dhttp.proxyHost=xxxx
-Dhttp.proxyPort=1234
-Dhttps.proxyHost=xxxx
-Dhttps.proxyPort=1234
-Dhttp.nonProxyHosts=*.xxx|*.yyyy
-Djava.net.useSystemProxies=true

If the plugin cannot use the proxy config of the IDE or the system for its HTTP client, it would at least be helpful to be able to disable the required auto-download and install the language server binary manually.