Worker binary deploy failed. Connection refused
Description Steps to reproduce Tried to connect to Codespaces through Jetbrains Gateway, and got this error Impact Additional context com.jetbrains.gateway.ssh.deploy.DeployException: Worker binary deploy failed: check command log for details: Connection refused: connect at com.jetbrains.gateway.ssh.GoWorkerDeployer.deploy$intellij_gateway_core(GoWorkerDeployer.kt:238) at com.jetbrains.gateway.ssh.GoWorkerDeployer$deploy$1.invokeSuspend(GoWorkerDeployer.kt) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at com.github.codespaces.jetbrains.gateway.connector.CodespacesConnectorService.getJetBrainsConnectionConfig(CodespacesConnectorService.kt:294) at com.github.codespaces.jetbrains.gateway.connector.CodespacesConnectorService.getJetBrainsConnectionConfig$default(CodespacesConnectorService.kt:292) at com.github.codespaces.jetbrains.gateway.connector.CodespacesConnectorService$prepareForJetBrainsConnection$1.run(CodespacesConnectorService.kt:245) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:425) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:509) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:190) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:591) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:666) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:622) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:590) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:177) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) 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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: com.intellij.ssh.SshException: Connection refused: connect at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.setUpSessionForSshJ(SshjConnectionUtil.kt:254) at com.intellij.ssh.impl.SshConnection.f(SshConnection.kt:211) at com.intellij.ssh.impl.SshConnection.access$doSshjSshConnection(SshConnection.kt:27) at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:204) at com.intellij.ssh.impl.SshConnection$createSshSessionForSshj$1.invoke(SshConnection.kt:201) at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:393) at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:374) at com.intellij.ssh.impl.SshConnection.c(SshConnection.kt:201) at com.intellij.ssh.impl.SshConnection.access$createSshSessionForSshj(SshConnection.kt:27) at com.intellij.ssh.impl.SshConnection$createSession$1.invoke(SshConnection.kt:189) at com.intellij.ssh.impl.SshConnection$createSession$1.invoke(SshConnection.kt:186) at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:393) at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:374) at com.intellij.ssh.impl.SshConnection.J(SshConnection.kt:186) at com.intellij.ssh.impl.SshConnection.access$createSession(SshConnection.kt:27) at com.intellij.ssh.impl.SshConnection$openChannel$1.invoke(SshConnection.kt:91) at com.intellij.ssh.impl.SshConnection$openChannel$1.invoke(SshConnection.kt:56) at com.intellij.ssh.Ssh.wrapBlockingSshCall(ssh.kt:393) at com.intellij.ssh.Ssh.wrapBlockingSshCall$default(ssh.kt:374) at com.intellij.ssh.impl.SshConnection.openChannel(SshConnection.kt:56) at com.intellij.ssh.SshConnectionService.exec(SshConnectionService.kt:215) at com.intellij.ssh.ExecBuilder.execute(ssh.kt:220) at com.intellij.ssh.ExecBuilder.execute$default(ssh.kt:214) at com.jetbrains.gateway.ssh.deploy.impl.SshCommandExecutor$executeCommand$process$1.invoke(SshCommandExecutor.kt:66) at com.jetbrains.gateway.ssh.deploy.impl.SshCommandExecutor$executeCommand$process$1.invoke(SshCommandExecutor.kt:60) at kotlinx.coroutines.InterruptibleKt.runInterruptibleInExpectedContext(Interruptible.kt:51) at kotlinx.coroutines.InterruptibleKt.access$runInterruptibleInExpectedContext(Interruptible.kt:1) at kotlinx.coroutines.InterruptibleKt$runInterruptible$2.invokeSuspend(Interruptible.kt:43) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 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) Caused by: java.net.ConnectException: Connection refused: 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:588) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:633) at net.schmizz.sshj.SocketClient.connect(SocketClient.java:107) at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.f(SshjConnectionUtil.kt:863) at com.intellij.ssh.impl.sshj.SshjConnectionUtilKt.f(SshjConnectionUtil.kt:224) at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) 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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833) OS: Windows 11 OS Version: 10.0 OS Architecture: amd64 Java Version: 17.0.5 Java Runtime Version: 17.0.5+1-b653.14 Java Vendor: JetBrains s.r.o. Available CPUs: 12 Max Memory: 1059061760 Free Memory: 75360560 Total Memory: 688914432 IDE Version: 2022.3 IDE: PhpStorm 2022.3 Plugin Version: 0.3.0.971 Plugin path: C:\Users\myuser\AppData\Roaming\JetBrains\PhpStorm2022.3\plugins\github-codespaces-gateway Plugin ID: com.github.codespaces.jetbrains.gateway

I run on 4-core machine
Hey @andrisan, sorry you're running into issues. Thanks for the info. If this happens again, would you be comfortable providing your idea.log from the gateway? You can retrieve it by hitting the cog wheel in the bottom left of the landing window in the gateway and hitting Collect all Logs. The entire log could have some sensitive data in it, so be sure to check it for any info you'd want to redact.
Does this happen consistently? Or are you able to connect sometimes?

I'm getting a similar error when I try to connect to a golang codespace (both from Gateway and from the Codespaces plugin in goland). This is the error message in connection_info.txt:
SSH connection to user@localhost:49566
* With altered connection settings:
- authMethods: PublicKey(privateKeys=[C:\Users\mesol\.ssh\codespaces.jetbrains, C:\Users\mesol\.ssh\id_rsa, C:\Users\mesol\.ssh\id_dsa, C:\Users\mesol\.ssh\id_ecdsa, C:\Users\mesol\.ssh\id_ed25519, C:\Users\mesol\.ssh\id_xmss], agent=NO), Password, KeyboardInteractive
- hostKeyVerifier: OpenSSH-like host key verifier (knownHostsFile=[C:\Users\mesol\.ssh\known_hosts], strictHostKeyChecking=NO, hashKnownHosts=false)
- port: 49566
- user: user
* Failed to connect to localhost/127.0.0.1 port 49566
* Failed to connect to localhost/0:0:0:0:0:0:0:1 port 49566
I'm able to access the codespace with the browser and also from my desktop using VS Code in case that helps. I also tried this with my firewall off and the problem persisted.
Same problem here - in addition, I use three devices, with two of them working as intended. So far, I could not find out what's causing this error on this specific machine yet.
Sorry you're running into issues. Is there additional logging that indicates the error that caused the failure, or are both also getting Caused by: com.intellij.ssh.SshException: Connection refused: connect?
With the information provided in @mesolimbo's message, the failure to connect could be caused by an issue with the SSH server (unlikely if 2 out of 3 devices can connect for @mjStallinger) or an issue with the local port forwarding to the codespace.
Knowing the plugin version and having additional logging (see here for collecting logs) and system information would be helpful for diagnosing the issue and comparing it against other reports (it seems like windows is the common platform).
Thanks in advance for any additional information!
My Gateway version is: 2023.1.1 My PHP storm version: 2022.3