jetbrains-gateway 1.2.1 says agent_id not exist

After my change to jetbrains-gateway got deployed i updated my template to use multiple agents and configured the jetbrains-gateway with one of the agent ids. Now i get the error in the pic when clicking on my pacharm button in coder. Connecting from jetbrains gateway works, all workspaces and agents are displayed there. It just doesn't display the agent ids so i can verify where the issue is. Any ideas how to debug this further?
No description
9 Replies
Codercord
Codercord4mo ago
Codercord
Codercord4mo ago
What are you creating this issue for?
daschatten
daschattenOP4mo ago
Ok, seems i broke the usage of jetbrains-gateway module with my patch. According to https://discord.com/channels/747933592273027093/1374825130030792754/1377454732649562113 and https://coder.com/docs/user-guides/workspace-access/jetbrains/toolbox it should be sufficient to append the agent_id to the jetbrains url. Though with agent_id the error as shown in the image above appears. Removing the agent_id from the given url solves this issue (for a single agent workspace). Maybe this is an issue in the coder plugin for jetbrains? Any idea @Atif
Coder
JetBrains Toolbox | Coder Docs
Access Coder workspaces from JetBrains Toolbox
daschatten
daschattenOP4mo ago
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["PY"]
default = "PY"

# Default folder to open when starting a JetBrains IDE
folder = "/home/${local.username}/myproject"

# This ensures that the latest non-breaking version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
version = "~> 1.2.1"

agent_id = coder_agent.main.id
order = 2
}
module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains-gateway/coder"

# JetBrains IDEs to make available for the user to select
jetbrains_ides = ["PY"]
default = "PY"

# Default folder to open when starting a JetBrains IDE
folder = "/home/${local.username}/myproject"

# This ensures that the latest non-breaking version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
version = "~> 1.2.1"

agent_id = coder_agent.main.id
order = 2
}
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
startup_script = <<-EOT
set -e

# Prepare user home with default files on first start.
if [ ! -f ~/.init_done ]; then
cp -rT /etc/skel ~
touch ~/.init_done
fi

# Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here

~/JetBrains/*/bin/remote-dev-server.sh registerBackendLocationForGateway
EOT

...
}
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
startup_script = <<-EOT
set -e

# Prepare user home with default files on first start.
if [ ! -f ~/.init_done ]; then
cp -rT /etc/skel ~
touch ~/.init_done
fi

# Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here

~/JetBrains/*/bin/remote-dev-server.sh registerBackendLocationForGateway
EOT

...
}
In CoderProtocolHandler.kt line 260 the agent is looked up with agents.firstOrNull { it.id.toString() == parameters.agentID() } Unfortunately i have no clue how to debug this part in the running toolbox app. Attaching intellij to the toolbox process does not work, seems some debug flags are missing. I could add some debug logs showing all the agent ids, build it and copy to the toolbox dir to run my version. Or is there a better way?
matifali
matifali3mo ago
Hi Coder has two different plugins for the Toolbox and the Gateway. Can you clarify which one you are using? Also, we only have a single module for Gateway. The Toolbox module has not been published yet.
daschatten
daschattenOP3mo ago
I assume it's the gateway plugin which is called from the url starting with "jetbrains-gateway://", isn't it?
matifali
matifali3mo ago
Yes it is. I saw you talking about Toolbox too, so was just confirming.
Phorcys
Phorcys3mo ago
hey, updating you on this, the last weeks have been very busy for me, and this week will be too so there is a lot of backlog that has built up so I apologize for the delay! If no one else from the team has had the time to figure this out I should be able to catch up with all open issues by next week EOW, I will try to leave an answer, even if it is an "i don't know" just so you know we're looking at this! thanks for your understanding :-) @daschatten since you are now using the Toolbox plugin (if i recall correctly) i guess we can close this out?
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?