Skip to content

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

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

Closed
cdosso opened this issue Sep 11, 2024 · 14 comments
Closed

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

cdosso opened this issue Sep 11, 2024 · 14 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@cdosso
Copy link
Contributor

cdosso commented Sep 11, 2024

Hello,

Since we upgraded coder from v2.10.3 to 2.14.2, we are unable to use gateway with coder plugin as we get the following error when we are at ide's selection step :

coder-jetbrains--test.app--coder.XXXX.XXX--bg : nodename nor servname provided,or not known

I tried upgrading phpstorm and coder plugin but with no luck. Nothing in debug logs

Digging into plugin source code, it seems that "coder-jetbrains--test.app--coder.XXXX.XXX--bg" should be an entry into ssh/config file but none is added. I also tried to manually add starting and ending blocks in ssh/config and everything is wipe out, so the plugin can access and write the file.

I'm on macos Sonoma.

Thx

@coder-labeler coder-labeler bot added bug help wanted Extra attention is needed labels Sep 11, 2024
@thomas-dussouillez
Copy link

Hello !
I have the same problem, it's blocking all our devs since we're all working on IntelliJ.
Thanks for the help on this !

@code-asher
Copy link
Member

code-asher commented Sep 11, 2024

Thank you for the report! Are you accessing the IDE through the recents screen? I think there is an issue where the SSH config is not regenerated from there, so we should make it do that.

As a workaround, it should regenerate properly if you add the connection again by going through the "Connect to Coder" or launching from the Coder dashboard.

If that still does not work, let me know.

@code-asher code-asher removed the help wanted Extra attention is needed label Sep 11, 2024
@cdosso
Copy link
Contributor Author

cdosso commented Sep 12, 2024

Hello, we already use the "Connect to coder" way. we tried resetting everything without success.

Is there anything we can enable to log what is going wrong? thankyou.

PS: BTW your plugin was working very good before, great job!

@code-asher
Copy link
Member

Thank you for the kind words.

If you could gather the logs from Gateway (using the cog icon in the lower left) and send them to me (either via email or you can upload them here) I will take a look and see what I can find.

@code-asher
Copy link
Member

It is strange though, if the blocks are getting replaced (you are talking about the # --- START CODER JETBRAINS blocks right?) then I am not sure how the --bg host is being skipped, there are no conditionals in that code as far as I can see. 🤔

@cdosso
Copy link
Contributor Author

cdosso commented Sep 12, 2024

Here is the issue:

2024-09-12 20:39:08,120 [1330103] INFO - CoderCLIManager - No workspaces and no existing config blocks to remove

related to this : https://github.com/coder/jetbrains-coder/blob/main/src/main/kotlin/com/coder/gateway/cli/CoderCLIManager.kt#L324

from my understanding .ssh/config is not written so the "fake" host cannot be reached.

N.B: we have several agents per workspace ( we use resources to nest multiples apps per workspace )

image

image
image

@cdosso
Copy link
Contributor Author

cdosso commented Sep 13, 2024

Fun fact: old workspaces with old coder agents (2.10) are still working. Is there any BC break on agent that could explain this issue ?

api version was 2.0 in 2.10 coder agent now it's 2.2

@cdosso
Copy link
Contributor Author

cdosso commented Sep 13, 2024

OMG. the issue is on our side,in workspace configuration. thank you very much for your time. sorry

@cdosso cdosso closed this as completed Sep 13, 2024
@code-asher
Copy link
Member

Glad you got it figured out!

@cdosso
Copy link
Contributor Author

cdosso commented Sep 16, 2024

Hi, I figured out why! the issue is related to the fact that you are relying on /api/v2/templateversion/ID/resource to get workspace resources. We have conditional parameters in tf template that make some resources unavailable by default so they are not evaluated.
Why don't you get running resources informations from /api/v2/workspace api call ?

@cdosso cdosso reopened this Sep 16, 2024
@coder-labeler coder-labeler bot added the help wanted Extra attention is needed label Sep 16, 2024
@code-asher
Copy link
Member

code-asher commented Sep 17, 2024

Oh interesting!

The reason we use the resource endpoint is that the API does not return resources for workspaces that are off, so when we configure SSH it would be missing all the agents from off workspaces, which could break connections in the recent connections view (say you try to connect to an agent from the recents view from a workspace that is off).

The CLI does the same thing when you run coder config-ssh, the plugin mimics that.

@code-asher
Copy link
Member

code-asher commented Sep 17, 2024

I thought we only did that if the workspace was off though, which I think is what you were suggesting.

@code-asher
Copy link
Member

code-asher commented Sep 17, 2024

Ahh apparently we just always fetch them, but we should use the resources in the workspaces call if the workspace is running, rather than trying to fetch them from resources since we already have them. I will try to get this issue on the roadmap next week.

fun resources(workspace: Workspace): List<WorkspaceResource> {
val resourcesResponse = retroRestClient.templateVersionResources(workspace.latestBuild.templateVersionID).execute()
if (!resourcesResponse.isSuccessful) {
throw APIResponseException("retrieve resources for ${workspace.name}", url, resourcesResponse)
}
return resourcesResponse.body()!!
}

@code-asher code-asher self-assigned this Sep 17, 2024
@cdosso
Copy link
Contributor Author

cdosso commented Oct 1, 2024

#489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants