SSH feature hangs on attempted login
MR: Fix blocking SSH connections (!9 - merged)
MR: bump version (!11 - merged)
MR: Bump version for gitlab workspaces proxy (gitlab-org/gitlab!166426 - merged)
Summary
A customer reported that here when attempting to SSH into a workspace, they get stuck waiting for the connection to get established which it never does.
Steps to reproduce
- setup workspaces locally by setting up GDK and following the workspaces docs
- create a workspace and acquire the name
- get your
load_balancer
IP by running:
export LOAD_BALANCER_EXTERNAL_IP=$(
kubectl -n ingress-nginx \
get svc ingress-nginx-controller \
--output jsonpath='{.status.loadBalancer.ingress[0].ip}'
)
ssh $WORKSPACE_NAME@$LOAD_BALANCER_EXTERNAL_IP
- When prompted for a password enter a PAT generated on GDK
- Observation: It hangs
What is the current bug behavior?
It hangs on attempt to SSH into a workspace
What is the expected correct behavior?
It SSH's into the workspace specified
Relevant logs and/or screenshots
Error log:
{"level":"error","ts":1726064647.8630404,"caller":"sshproxy/utils.go:17","msg":"failed to send request to connection","error":"ssh: disconnect, reason 11: disconnected by user","workspace_name":"workspace-3-1-z67yjf","stacktrace":"gitlab.com/workspaces/gitlab-workspaces-proxy/pkg/sshproxy.(*SSHProxy).copyRequests\n\t/app/pkg/sshproxy/utils.go:17\ngitlab.com/workspaces/gitlab-workspaces-proxy/pkg/sshproxy.(*SSHProxy).handleSSHConnection\n\t/app/pkg/sshproxy/server.go:131"}
Possible fixes
Suspected offender: gitlab-org/remote-development/gitlab-workspaces-proxy!58 (diffs)
Reasoning
Those lines in the diff do not handle the transfer of data between the different network buffers in separate goroutines, causing the SSH request to block incoming connections in the channel here
I locally reverted those lines to run in their own goroutine as they did before the diff and I am able to ssh into the workspace I spun up locally. I could not do this before the patch I did. The customer's log does not match mine due to a difference in setup I am assuming, but they did report they were stuck after the SSH command (which is essentially what I experienced before the patch I did)
I think this is also more likely to be the issue because these changes were shipped in v0.1.13 along with other changes (this can be observed from checking the version
in the chart file in the MR ( it reports 0.1.12 which was a previous release)