Skip to content

gosshagent.ForwardToRemote fails with ssh agent from git for windows #875

Description

@adastraperangusta

Hello,

I am using DevPod v0.5.0-alpha.1 on windows (build 1607) and I am using ssh client from git.

What happened?

I'm getting the following error every time i try to set up a workspace (with any provider like ssh or docker)

[14:41:38] info Workspace src-1 already exists
[14:41:38] debug Acquire workspace lock...
[14:41:38] debug Acquired workspace lock...
[14:41:38] info Creating devcontainer...
[14:41:38] debug Inject and run command: '/tmp/devpod/agent' helper ssh-server --stdio --debug
[14:41:38] debug execute inject script
[14:41:38] debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.0-alpha.1
[14:41:38] debug Attempting to create SSH client
[14:41:38] debug Run command provider command: ${SSH_PROVIDER} command
[14:41:46] debug Received line after pong: done
[14:41:46] debug SSH client created
[14:41:46] debug SSH session created
[14:41:47] info Execute SSH server command: bash -c '/tmp/devpod/agent' agent workspace up --workspace-info '....' --debug
[14:41:47] info No root required, because neither docker nor agent daemon needs to be installed
[14:41:47] info Use /home/user/.devpod/agent/contexts/default/workspaces/src-1 as workspace dir
[14:41:47] debug Created logger
[14:41:47] debug Received ping from agent
[14:41:47] debug Credentials server started on port 16886...
[14:41:48] debug Incoming client connection at /
[14:41:48] debug Credentials server started...
[14:41:48] debug Wrote docker credentials helper to /home/user/.devpod/agent/contexts/default/workspaces/src-1/.cache/hmofachtfmjr/docker-credential-devpod
[14:41:48] debug Workspace Folder already exists /home/user/.devpod/agent/contexts/default/workspaces/src-1/content
[14:41:48] debug Workspace exists, skip downloading
[14:41:48] debug Using docker command 'docker'
[14:41:48] info find dev container: docker ps: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[14:41:48] info exit status 1
[14:41:48] info devcontainer up
[14:41:48] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[14:41:48] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:95
[14:41:48] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[14:41:48] info /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:52
[14:41:48] info github.com/spf13/cobra.(*Command).execute
[14:41:48] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
[14:41:48] info github.com/spf13/cobra.(*Command).ExecuteC
[14:41:48] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
[14:41:48] info github.com/spf13/cobra.(*Command).Execute
[14:41:48] info /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
[14:41:48] info github.com/loft-sh/devpod/cmd.Execute
[14:41:48] info /home/runner/work/devpod/devpod/cmd/root.go:90
[14:41:48] info main.main
[14:41:48] info /home/runner/work/devpod/devpod/main.go:8
[14:41:48] info runtime.main
[14:41:48] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/proc.go:250
[14:41:48] info runtime.goexit
[14:41:48] info /opt/hostedtoolcache/go/1.20.5/x64/src/runtime/asm_amd64.s:1598
[14:41:48] debug done inject
[14:41:48] debug done injecting
[14:41:48] debug Done InjectAgentAndExecute
[14:41:48] debug Connection to SSH Server closed
[14:41:48] debug Done executing ssh server helper command
[14:41:48] debug Done creating devcontainer
[14:41:48] debug done exec
[14:41:48] fatal dial unix /tmp/ssh-pXI49uWqMjo3/agent.1902: socket: Une adresse incompatible avec le protocole demandé a été utilisée.
forward agent
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        D:/a/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:109
runtime.goexit
        C:/hostedtoolcache/windows/go/1.20.5/x64/src/runtime/asm_amd64.s:1598

"Une adresse incompatible avec le protocole demandé a été utilisée." means "An address incompatible with the requested protocol was used."

I have checked in a git bash :

$  ls /tmp/ssh-pXI49uWqMjo3/agent.1902
/tmp/ssh-pXI49uWqMjo3/agent.1902=

BTW, I have the same error message if I put any non-existing file in SSH_AUTH_SOCK environment varaible.

What did you expect to happen instead?
Being able to have a fully working workspace.

How can we reproduce the bug? (as minimally and precisely as possible)

create any workspace on any ssh backend will fail

Local Environment:

  • DevPod Version: 0.5.0-alpha.1
  • Operating System: windows (build 1607)
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: docker and ssh

Anything else we need to know?
ssh from latest portable git bash for windows.

ssh-agent works great with other programs (vs code, idea, shh ...).

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions