C
Coder.com2mo ago
Scott

Older workspace no longer working

I went to fire up an older workspace and I seem to have issues with it. My first issue was I was installing an older version of Coder for the agent (the version was fixed for some reason). Now my workspace is running (in k8s), but when VSCode tries to set the remote connection, I get this error:
No description
25 Replies
Codercord
Codercord2mo ago
<#1309440027125612614>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Scott
ScottOP2mo ago
I have other workspaces running just fine. So, I decided to look at the Remote-SSH terminal output. The difference where the broken connection happens is here:
[09:46:53.217] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
listeningOn====
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==9==
execServerToken==a111a111-1111-111a-1aa1-1a1a1aaa1111==

[09:46:53.218] Failed to parse remote port from server output
[09:46:53.219] Resolver error: Error:
at m.Create (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:501230)
at t.handleInstallOutput (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:498552)
at t.tryInstall (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:623316)
at async c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:582788
at async t.withShowDetailsEvent (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:586054)
at async k (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:579675)
at async t.resolve (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:583465)
at async c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:851126
[09:46:53.222]
[09:46:53.217] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
listeningOn====
osReleaseId==debian==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==9==
execServerToken==a111a111-1111-111a-1aa1-1a1a1aaa1111==

[09:46:53.218] Failed to parse remote port from server output
[09:46:53.219] Resolver error: Error:
at m.Create (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:501230)
at t.handleInstallOutput (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:498552)
at t.tryInstall (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:623316)
at async c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:582788
at async t.withShowDetailsEvent (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:586054)
at async k (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:579675)
at async t.resolve (c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:583465)
at async c:\Users\Scott\.vscode\extensions\ms-vscode-remote.remote-ssh-0.113.1\out\extension.js:2:851126
[09:46:53.222]
The working connection has:
listeningOn==127.0.0.1:42177==
listeningOn==127.0.0.1:42177==
So, I'm guessing that is the cause of the problem, since this value is missing. And that is about as far as I can get with troubleshooting. Any suggestions to fix this would be greatly appreciated. 🙂 Oh, I also reconfiged SSH with coder config-ssh, but that didn't help any.
Phorcys
Phorcys2mo ago
hey @Scott, do you have the full workspace build logs? yeah, all this command really does is set up your local ssh client's config to be able to connect to Coder workspaces using ssh coder.<workspace>
Scott
ScottOP2mo ago
I thought VSCode would use that config too, to connect to the workspace. 🤔 Let me get the build logs.
Scott
ScottOP2mo ago
Scott
ScottOP2mo ago
Hmm..is that the right version? Well, it's the same version running in my running workspaces. Why it is installing twice, I have no idea.... 🤔
Phorcys
Phorcys2mo ago
vscode uses a specific config it's similar to config-ssh but it is still a separate thing that's weird, it should work okay
Scott
ScottOP5w ago
Do you know where the VSCode config is saved? @Phorcys
zounce
zounce5w ago
are you able to ssh into the workspace via coder ssh?
Scott
ScottOP5w ago
Hi Ethan. Yes, I can. It's definitely this error causing the SSH connection to fail:
[12:29:07.291] Failed to parse remote port from server output
Phorcys
Phorcys5w ago
it edits your SSH config
Phorcys
Phorcys5w ago
No description
Phorcys
Phorcys5w ago
No description
Scott
ScottOP5w ago
Ok. Looks like the config is general to the Coder server. Nothing specific for each workspace. 🤔 So, it's something not being given from the server, when the connection is being made. The remote port. Any chance someone from the team that knows more about the SSH inner working can help possibly?
Phorcys
Phorcys5w ago
yes i'll ask internally :-)
Scott
ScottOP5w ago
Thanks! 🙂
Phorcys
Phorcys5w ago
@Scott could you send your template over? (the version used by this specific workspace)
Scott
ScottOP5w ago
Here is the template.
Scott
ScottOP5w ago
Scott
ScottOP5w ago
The workspace is supposed to open next to a Keycloak deployment, to work on html templates for usage within Keycloak. Looking at the pod, I found this.
2024-11-27 08:06:12.372 [warn] run exited with error ...
error= GET https://my.coder.url/api/v2/workspaceagents/me/rpc?version=2.2: unexpected status code 401: Workspace agent not authorized.: Try logging in using 'coder login'.
Error: The agent cannot authenticate until the workspace provision job has been completed. If the job is no longer running, this agent is invalid.
2024-11-27 08:06:12.372 [warn] run exited with error ...
error= GET https://my.coder.url/api/v2/workspaceagents/me/rpc?version=2.2: unexpected status code 401: Workspace agent not authorized.: Try logging in using 'coder login'.
Error: The agent cannot authenticate until the workspace provision job has been completed. If the job is no longer running, this agent is invalid.
Token not getting through as an env variable? 🤔
Phorcys
Phorcys4w ago
and you said that coder ssh works on that workspace?
Scott
ScottOP4w ago
Yes, without a hitch. 🙂 I've fixed the problem, but don't know the cause. It's the container. I swapped the container for one that was working in another workspace and the connection worked with that other container. Though, I don't know what might be the issue with the old container. I'm going to experiment some more. Maybe I'll figure it out.
Phorcys
Phorcys4w ago
that's really weird please let us know if you find the root cause! sorry for not answering earlier, i'm not currently home and couldn't find the time to look into it yet
Scott
ScottOP4w ago
So, I have no idea what can be the issue. This is the container, if you wish to play with it. docker.io/m8aio/node-18 I've upgraded the container now being used by the workspace to node 20 (and created a new image), which was the base for the other working container too and the workspace is running with the new container perfectly now also. Maybe that was it? I don't know. 🤷🏻‍♂️
Codercord
Codercord2w ago
@Phorcys closed the thread.

Did you find this page helpful?