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

Failed to retrieve IDEs: nodename nor servname provided,or not known #508

Open
MrPeacockNLB opened this issue Dec 5, 2024 · 10 comments
Open
Labels

Comments

@MrPeacockNLB
Copy link

MrPeacockNLB commented Dec 5, 2024

Description

For me is #477 not fixed. This happens with latest main release of Coder v2.18.0 and latest Jetbrains Gateway 2024.3. Coder provider plugin is at version 2.15.1.

Image

As one could see the --bg host is not found on a Windows machine. Even the entry is in ssh config file. Curious is that the same Workspace (we open IntelliJ via Button and using URI handler) works on a linux system. It seems this has something to do with Windows implementation.

This is a blocker for us as it is unable to start new IntelliJ based workspaces from Windows clients.

@coder-labeler coder-labeler bot added the blocked label Dec 5, 2024
@Bert-Derijckere
Copy link

Bert-Derijckere commented Dec 25, 2024

I am running into the same problem on a Windows machine. I've tried the connection from within IntelliJ Ultimate and from within Jetbrains Gateway.

There seems to be a problem in de SSH config. I cannot even connect with plain ssh.

I run coder config-ssh, I can see the changes in ~/.ssh/config. When I run ssh coder.a, I get the following output:

/bin/sh: line 0: exec: C:Usersb.derijckereAppDataLocalcoder-gateway82pk376jkrj44.pit-1.try.coder.appcoder-windows-amd64.exe: not found
kex_exchange_identification: Connection closed by remote host

It seems to want to fail to execute the ProxyCommand

If I change the single \ in the ProxyCommand to \, from ProxyCommand C:\Users\b.derijckere\AppData\Local\coder-gateway\82pk376jkrj44.pit-1.try.coder.app\coder-windows-amd64.exe ... to ProxyCommand C:\\Users\\b.derijckere\\AppData\\Local\\coder-gateway\\82pk376jkrj44.pit-1.try.coder.app\\coder-windows-amd64.exe ..., then the SSH connection succeeds.

Unfortunately, I cannot make the same changes in de config for the Host coder-jetbrain--... since that config is overwritten by the coder-gateway plugin each time.


Coder version:

Coder v2.18.1+765d99c Mon Dec 16 19:49:21 UTC 2024
https://github.com/coder/coder/commit/765d99caa31bbd0108286846c594cb18031fe962

Slim build of Coder, does not support the  server  subcommand.

Coder plugin version in JetBrains Gateway en IntellijJ Ultimate: 2.15.1

@code-asher
Copy link
Member

Oh interesting, sounds like we need to update the config to use the double slashes. I wonder if it works when the shell is command prompt or powershell, but not sh?

@MrPeacockNLB
Copy link
Author

@code-asher let me know if I can support you or if you need more information.

@code-asher
Copy link
Member

I am not currently able to work on the plugin, but definitely happy to review any PRs. One trick here though is that I think we may need to make sure it still works for Powershell/command prompt as well, although I think the double slash syntax would work there as well?

@code-asher
Copy link
Member

I will bring up the issue at our next planning meeting though and see if someone can take it.

@isaacte
Copy link

isaacte commented Feb 11, 2025

Same problem here when trying to connect from the Jetbrains Gateway. Using the manual configuration via SSH does not have any problem.

@djarbz
Copy link

djarbz commented Feb 16, 2025

I am experiencing a similar issue on Windows.
This is a brand new computer and I just installed Gateway.
JetBrains Gateway 2024.3.3 Build #GW-243.24978.56
Coder version: 2.18.0

Clicking on the IDE launcher from the Workspace dashboard launches Gateway.
Image

As far as I can tell, nothing is written to my ssh config file.
I did notice in the idea.log that it was having difficulty with the ssh agent, to which I noticed that the OpenSSH Authentication Agent service was disabled. I started that, but still have the above error.

I then installed the coder CLI and generated the coder block in my ssh config, still no luck.
However, I noticed that my hostname is actually coder-jetbrains-coder.domain.com-bg--user-workspace.main so I duplicated the block and updated the hostname to Host coder-jetbrains-coder.*.
Now it gets further, but still fails to connect.

Image

#c.i.s.ProxyCommand - End of Process[pid=14416, exitValue=1] stderr: 
Encountered an error running "coder ssh", see "coder ssh --help" for more information
error: Resource not found or you do not have access to this resource

Sanitized Gateway Log for the attempt.

2025-02-16 00:11:11,814 [  26441]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Loading global entities com.intellij.platform.workspace.jps.entities.SdkEntity from files
2025-02-16 00:11:11,816 [  26443]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Loading global entities com.intellij.platform.workspace.jps.entities.LibraryEntity from files
2025-02-16 00:11:11,826 [  26453]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2025-02-16 00:11:11,827 [  26454]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2025-02-16 00:11:11,875 [  26502]   INFO - #c.i.a.o.PathMacrosImpl - Saved path macros: {}
2025-02-16 00:11:11,877 [  26504]   INFO - #c.i.c.ComponentStoreImpl - Saving appActionMacroManager took 34 ms
2025-02-16 00:11:17,431 [  32058]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2025-02-16 00:11:17,432 [  32059]   INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
2025-02-16 00:11:18,318 [  32945]   INFO - CoderRemoteConnectionHandle - Connecting to remote worker on coder-jetbrains-coder.example.com--<USER>--<WORKSPACE>.main... (attempt 3)
2025-02-16 00:11:18,359 [  32986]   INFO - net.schmizz.sshj.transport.random.JCERandom - Creating new SecureRandom.
2025-02-16 00:11:18,382 [  33009]   INFO - #c.i.s.ProxyCommand - ProxyCommand for coder-jetbrains-coder.example.com-bg--<USER>--<WORKSPACE>.main:22: "C:\Program Files\Coder\bin\coder.exe" --global-config C:\Users\<USER>\AppData\Roaming\coderv2 ssh --stdio --ssh-host-prefix coder. coder-jetbrains-coder.example.com-bg--<USER>--<WORKSPACE>.main
2025-02-16 00:11:18,385 [  33012]   INFO - #c.i.s.ProxyCommand - Started ProxyCommand for coder-jetbrains-coder.example.com-bg--<USER>--<WORKSPACE>.main:22: Process[pid=14416, exitValue="not exited"]
2025-02-16 00:11:18,385 [  33012]   INFO - #c.i.s.i.s.sshj - Client identity string: SSH-2.0-IntelliJ__Gateway_GW-243.24978.56__SSHJ_0.38.1_SNAPSHOT
2025-02-16 00:11:20,663 [  35290]   WARN - #c.i.s.i.s.sshj - Received end of connection, but no identification received. 
2025-02-16 00:11:20,664 [  35291]   INFO - #c.i.s.ProxyCommand - End of Process[pid=14416, exitValue=1] stderr: 
Encountered an error running "coder ssh", see "coder ssh --help" for more information
error: Resource not found or you do not have access to this resource
2025-02-16 00:11:20,670 [  35297]   WARN - #c.i.s.ProxyCommand - Process[pid=14416, exitValue=1] exited with code 1
2025-02-16 00:11:20,671 [  35298] SEVERE - CoderRemoteConnectionHandle - Failed to connect (attempt 3; will retry in 19091 ms)
java.lang.Throwable: Failed to connect (attempt 3; will retry in 19091 ms)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
	at com.coder.gateway.CoderRemoteConnectionHandle$connect$1$2.invoke(CoderRemoteConnectionHandle.kt:144)
	at com.coder.gateway.CoderRemoteConnectionHandle$connect$1$2.invoke(CoderRemoteConnectionHandle.kt:76)
	at com.coder.gateway.util.RetryKt.suspendingRetryWithExponentialBackOff(Retry.kt:62)
	at com.coder.gateway.util.RetryKt$suspendingRetryWithExponentialBackOff$1.invokeSuspend(Retry.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:102)
	at com.intellij.openapi.rd.util.CoroutineProgressContext$Companion$create$task$1$3.invokeSuspend(BackgroundProgressCoroutineUtil.kt:292)
	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:277)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:111)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$BuildersKt__BuildersKt(Builders.kt:84)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:52)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at com.intellij.openapi.rd.util.CoroutineProgressContext$Companion.create$lambda$2(BackgroundProgressCoroutineUtil.kt:288)
	at com.intellij.openapi.rd.util.CoroutineProgressContext$Companion$createBackgroundable$1$1.run(BackgroundProgressCoroutineUtil.kt:311)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:491)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$7(CoreProgressManager.java:542)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:223)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:45)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:222)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:674)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:673)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:203)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249)
	at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:502)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:467)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:109)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:103)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:463)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)
2025-02-16 00:11:20,672 [  35299] SEVERE - CoderRemoteConnectionHandle - JetBrains Gateway 2024.3.3  Build #GW-243.24978.56
2025-02-16 00:11:20,672 [  35299] SEVERE - CoderRemoteConnectionHandle - JDK: 21.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2025-02-16 00:11:20,673 [  35300] SEVERE - CoderRemoteConnectionHandle - OS: Windows 11
2025-02-16 00:11:20,673 [  35300] SEVERE - CoderRemoteConnectionHandle - Plugin to blame: Coder version: 2.18.0
2025-02-16 00:11:20,673 [  35300] SEVERE - CoderRemoteConnectionHandle - Last Action: 
2025-02-16 00:11:37,072 [  51699]   INFO - CoderRemoteConnectionHandle - Connection canceled due to JobCancellationException

@djarbz
Copy link

djarbz commented Feb 18, 2025

I was able to successfully connect on my older laptop.

Here is the ssh config

Host coder-jetbrains--<WORKSPACE>.main--coder.domain.com
  ProxyCommand "C:\Users\<USER>\AppData\Local\coder-gateway\coder.domain.com\coder-windows-amd64.exe" --global-config "C:\Users\<USER>\AppData\Local\coder-gateway\coder.domain.com\config" ssh --stdio <WORKSPACE>.main
  ConnectTimeout 0
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  LogLevel ERROR
  SetEnv CODER_SSH_SESSION_TYPE=JetBrains

And coder CLI version

>coder-windows-amd64.exe --version
Coder v2.19.0+2f32b11 Tue Feb  4 07:53:51 UTC 2025
https://github.com/coder/coder/commit/2f32b11831a236ed550f35b2296b8f948eb64f4e

Jetbrains 2024.1.1
Coder Plugin 2.10.0

@djarbz
Copy link

djarbz commented Feb 18, 2025

I just updated the plugin on the laptop, I go a No Connection Handle returned error when it tired to connect to the workspace.
Clicked OK, but now is failing to connect with the coder-jetbrains-coder.domain.com-bg--user-workspace.main style URL.

I think I can confidently say the issue is with the new connection URL.

I also checked my DNS logs when trying to connect from my new PC after adding the corrected ssh config host and there is a query for the new style URL, which obviously fails to resolve.

@code-asher
Copy link
Member

For anyone on 2.18.1, the problem might be #534.

For pre-2.18.1, the problem is something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants