devpod icon indicating copy to clipboard operation
devpod copied to clipboard

[email protected]: Permission denied (publickey)

Open gdw2 opened this issue 1 year ago • 5 comments

I'm attempting to devpod up a private repo. See below.

After it fails, I can devpod ssh cousin and clone the repo in question just fine. I'm not sure how to troubleshoot further.

Where is the /home/devpod directory? It's not on the client or on the VM filesystem. Is it in a container?

$ devpod up [email protected]:gdw2/cousin.git --ide openvscode --debug
15:40:45 info Deleting 'digitalocean' machine 'cousin'...
15:40:50 info Please hang on, DevPod is still running, this might take a while...
15:40:55 info Please hang on, DevPod is still running, this might take a while...
15:41:00 info Please hang on, DevPod is still running, this might take a while...
15:41:03 done Successfully deleted machine 'cousin'
15:41:03 done Successfully deleted workspace 'cousin'

15:46:26 info Create machine 'cousin' with provider 'digitalocean'...
15:46:26 debug Run create provider command: ${DO_PROVIDER} create
15:46:31 done Successfully created machine 'cousin' with provider 'digitalocean'
15:46:31 debug Acquire workspace lock...
15:46:31 debug Acquired workspace lock...
15:46:31 debug Acquire machine lock...
15:46:31 debug Acquired machine lock...
15:46:31 debug Run status provider command: ${DO_PROVIDER} status
15:46:34 debug Run status provider command: ${DO_PROVIDER} status
15:46:37 debug Run status provider command: ${DO_PROVIDER} status
15:46:40 debug Run status provider command: ${DO_PROVIDER} status
15:46:43 debug Run status provider command: ${DO_PROVIDER} status
15:46:43 info Waiting for workspace to come up...
15:46:43 debug Got status Busy, expected: Running
15:46:45 debug Run status provider command: ${DO_PROVIDER} status
15:46:48 debug Run status provider command: ${DO_PROVIDER} status
15:46:50 debug Run status provider command: ${DO_PROVIDER} status
15:46:53 debug Run status provider command: ${DO_PROVIDER} status
15:46:54 info Waiting for workspace to come up...
15:46:54 debug Got status Busy, expected: Running
15:46:56 debug Run status provider command: ${DO_PROVIDER} status
15:46:58 debug Run status provider command: ${DO_PROVIDER} status
15:47:01 debug Run status provider command: ${DO_PROVIDER} status
15:47:04 debug Run status provider command: ${DO_PROVIDER} status
15:47:04 info Waiting for workspace to come up...
15:47:04 debug Got status Busy, expected: Running
15:47:06 debug Run status provider command: ${DO_PROVIDER} status
15:47:09 debug Run status provider command: ${DO_PROVIDER} status
15:47:12 debug Run status provider command: ${DO_PROVIDER} status
15:47:15 debug Run status provider command: ${DO_PROVIDER} status
15:47:16 info Waiting for workspace to come up...
15:47:16 debug Got status Busy, expected: Running
15:47:18 debug Run status provider command: ${DO_PROVIDER} status
15:47:20 debug Run status provider command: ${DO_PROVIDER} status
15:47:23 debug Run status provider command: ${DO_PROVIDER} status
15:47:26 debug Run status provider command: ${DO_PROVIDER} status
15:47:27 info Waiting for workspace to come up...
15:47:27 debug Got status Busy, expected: Running
15:47:29 debug Run status provider command: ${DO_PROVIDER} status
15:47:31 debug Run status provider command: ${DO_PROVIDER} status
15:47:34 debug Run status provider command: ${DO_PROVIDER} status
15:47:37 debug Run status provider command: ${DO_PROVIDER} status
15:47:38 info Creating devcontainer...
15:47:38 debug Inject and run command: '/home/devpod/.devpod/devpod' agent workspace up --workspace-info 'H4sIAAAAAAAA/+xUXW/bNhT9KwOxR8miqC9LTzNsIdXS2IGjFGiLwaDIS5uLJAoi5aQw/N8H+iNzirRZnvawPVk0z/0451zeHXpU/YPuKAOU7ZDkKENMDVq2yEHD4ZgyXAkRcTeOUuqGMU/dcRCAW0EU4SSClMYYOUiomkOPMuRtVAPemj96Iw7bTnGPqdbAk9EeB0GH2njPNbX3XKzr1VYeMuxQSxtAGeJyLQ2tFQPaor2DGso2sj00evosXvRLB6NmUIMBlJl+gL2DJIeLhKqDdquZ4mDTaTX0R9praZbQKS2N6r+hzJ5/W0uzGaoRU0225o/k1OhoLY2NZT1QI1Vbyga0oU2HMkQwCVycuJiUxM/COCPxF+Sgmmpzr4H/GHHSxzI+CvQd2ZeuvEfoU5J3yOwg1Vli2gImV/m8XM0m5WR1Oyk/2L+2tB7gufip7rk+XUN7aP4Y+I9ijj82aFbcXa+Km8lVfhnEFXuA3iXYxeEz6q748gIUYHtVzCfTsvhUlJ9XZXGTL+7LS4yPmyPo93xarmaL6XW+XE2X+Syfl8Xk490l1k7PBfiqKN9C3kymH4p5vio/377oTLvhlnWDO15XFrbMr4rF/BIgeurbm3Jxnc9fEu9WW38Vj0NOggCHCRlDEKVxgClnFTAhKgJxWqWJCOKgwjRmUHEuIGQB8wOM2RhCGth3rKG/PfrOTy9j/74ZfnVCj25nO9RRs3nDXgdxaujtT4DHbA7i6rGtFeX3y48oQxtjOp153t+v0auVMK7enON7qIFq0N450NvikT/y7U6SLWVGbqX5ZjmqwZzGwN78CcxcSTPtgUNrJK312c3z7ewwea8C4AmYZa43g7F1UfYV/bqbLVa3y8WnYpYv979oozr0x95BlWxpL+HwoC4QKPu6Q8rmrGU7PNn11TOrDm14HFrNN8Ae9NCgDCWJH5JxRHhSEYxJlaYijivALEwjLkQSBAEHwplfQZVSAWPiCww+pEkaCAK245NHb+rpnheEe7kWXlcZj8hPo9wDM/dIaO/8gG7ffE93zGkapwHnPmFh5LO44nEyHoc84AICQlIRV5xgIFEMKaNRCCCYz7hPK+wngv/LdA+E9tb6h6GCvgVzMH/vnHaZ/d7/v2f/I3v2LwAAAP//AQAA//8iACVoYgkAAA==' --debug
15:47:38 debug execute inject script
15:47:38 debug Run command provider command: ${DO_PROVIDER} command
15:47:46 debug create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
15:47:46 debug done exec
15:47:46 debug done inject
15:47:46 debug done injecting
15:47:46 info Waiting for devpod agent to come up...
15:47:46 debug Inject Error: create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
EOF
15:47:49 debug execute inject script
15:47:49 debug Run command provider command: ${DO_PROVIDER} command
15:47:49 debug create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
15:47:49 debug done exec
15:47:49 debug done inject
15:47:49 debug done injecting
15:47:49 debug Inject Error: create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
EOF
15:47:52 debug execute inject script
15:47:52 debug Run command provider command: ${DO_PROVIDER} command
15:47:54 debug create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
15:47:54 debug done exec
15:47:54 debug done inject
15:47:54 debug done injecting
15:47:54 info Waiting for devpod agent to come up...
15:47:54 debug Inject Error: create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
EOF
15:47:57 debug execute inject script
15:47:57 debug Run command provider command: ${DO_PROVIDER} command
15:47:58 debug create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
15:47:58 debug done exec
15:47:58 debug done inject
15:47:58 debug done injecting
15:47:58 debug Inject Error: create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
EOF
15:48:01 debug execute inject script
15:48:01 debug Run command provider command: ${DO_PROVIDER} command
15:48:02 debug create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
15:48:02 debug done exec
15:48:02 debug done inject
15:48:02 debug done injecting
15:48:02 info Waiting for devpod agent to come up...
15:48:02 debug Inject Error: create ssh client: dial to 188.166.163.53:22 failed: dial tcp 188.166.163.53:22: connect: connection refused
EOF
15:48:05 debug execute inject script
15:48:05 debug Run command provider command: ${DO_PROVIDER} command
15:48:15 debug done inject
15:48:15 debug done injecting
15:48:15 info Waiting for devpod agent to come up...
15:48:15 debug Inject Error: context deadline exceeded
15:48:15 debug done exec
15:48:18 debug execute inject script
15:48:18 debug Run command provider command: ${DO_PROVIDER} command
15:48:28 debug done inject
15:48:28 debug done injecting
15:48:28 info Waiting for devpod agent to come up...
15:48:28 debug Inject Error: context deadline exceeded
15:48:28 debug done exec
15:48:31 debug execute inject script
15:48:31 debug Run command provider command: ${DO_PROVIDER} command
15:48:41 debug done inject
15:48:41 debug done injecting
15:48:41 info Waiting for devpod agent to come up...
15:48:41 debug Inject Error: context deadline exceeded
15:48:41 debug done exec
15:48:44 debug execute inject script
15:48:44 debug Run command provider command: ${DO_PROVIDER} command
15:48:54 debug done inject
15:48:54 debug done injecting
15:48:54 info Waiting for devpod agent to come up...
15:48:54 debug Inject Error: context deadline exceeded
15:48:54 debug done exec
15:48:57 debug execute inject script
15:48:57 debug Run command provider command: ${DO_PROVIDER} command
15:49:05 debug Received line after pong: done
15:49:05 debug Error trying to reach docker daemon: docker ps: exit status 1
15:49:05 debug Rerun as root: /home/devpod/.devpod/devpod agent workspace up --workspace-info H4sIAAAAAAAA/+xUXW/bNhT9KwOxR8miqC9LTzNsIdXS2IGjFGiLwaDIS5uLJAoi5aQw/N8H+iNzirRZnvawPVk0z/0451zeHXpU/YPuKAOU7ZDkKENMDVq2yEHD4ZgyXAkRcTeOUuqGMU/dcRCAW0EU4SSClMYYOUiomkOPMuRtVAPemj96Iw7bTnGPqdbAk9EeB0GH2njPNbX3XKzr1VYeMuxQSxtAGeJyLQ2tFQPaor2DGso2sj00evosXvRLB6NmUIMBlJl+gL2DJIeLhKqDdquZ4mDTaTX0R9praZbQKS2N6r+hzJ5/W0uzGaoRU0225o/k1OhoLY2NZT1QI1Vbyga0oU2HMkQwCVycuJiUxM/COCPxF+Sgmmpzr4H/GHHSxzI+CvQd2ZeuvEfoU5J3yOwg1Vli2gImV/m8XM0m5WR1Oyk/2L+2tB7gufip7rk+XUN7aP4Y+I9ijj82aFbcXa+Km8lVfhnEFXuA3iXYxeEz6q748gIUYHtVzCfTsvhUlJ9XZXGTL+7LS4yPmyPo93xarmaL6XW+XE2X+Syfl8Xk490l1k7PBfiqKN9C3kymH4p5vio/377oTLvhlnWDO15XFrbMr4rF/BIgeurbm3Jxnc9fEu9WW38Vj0NOggCHCRlDEKVxgClnFTAhKgJxWqWJCOKgwjRmUHEuIGQB8wOM2RhCGth3rKG/PfrOTy9j/74ZfnVCj25nO9RRs3nDXgdxaujtT4DHbA7i6rGtFeX3y48oQxtjOp153t+v0auVMK7enON7qIFq0N450NvikT/y7U6SLWVGbqX5ZjmqwZzGwN78CcxcSTPtgUNrJK312c3z7ewwea8C4AmYZa43g7F1UfYV/bqbLVa3y8WnYpYv979oozr0x95BlWxpL+HwoC4QKPu6Q8rmrGU7PNn11TOrDm14HFrNN8Ae9NCgDCWJH5JxRHhSEYxJlaYijivALEwjLkQSBAEHwplfQZVSAWPiCww+pEkaCAK245NHb+rpnheEe7kWXlcZj8hPo9wDM/dIaO/8gG7ffE93zGkapwHnPmFh5LO44nEyHoc84AICQlIRV5xgIFEMKaNRCCCYz7hPK+wngv/LdA+E9tb6h6GCvgVzMH/vnHaZ/d7/v2f/I3v2LwAAAP//AQAA//8iACVoYgkAAA== --debug
15:49:05 debug Use /home/devpod/.devpod/agent/contexts/default/workspaces/cousin as workspace dir
15:49:06 debug Created logger
15:49:06 debug Received ping from agent
15:49:06 debug Credentials server started on port 16218...
15:49:07 debug Incoming client connection at /
15:49:08 debug Credentials server started...
15:49:08 info Download binary DO_PROVIDER from https://github.com/loft-sh/devpod-provider-digitalocean/releases/download/v0.0.2/devpod-provider-digitalocean-linux-amd64
15:49:09 debug Successfully downloaded binary https://github.com/loft-sh/devpod-provider-digitalocean/releases/download/v0.0.2/devpod-provider-digitalocean-linux-amd64
15:49:09 debug Clone Repository
15:49:10 info Cloning into '/home/devpod/.devpod/agent/contexts/default/workspaces/cousin/content'...
15:49:10 info Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
15:49:10 info [email protected]: Permission denied (publickey).
15:49:11 debug exit status 128
15:49:11 debug error cloning repository
15:49:11 debug github.com/loft-sh/devpod/cmd/agent/workspace.CloneRepository
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:469
15:49:11 debug github.com/loft-sh/devpod/cmd/agent/workspace.prepareWorkspace
15:49:11 info fatal: Could not read from remote repository.
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:213
15:49:11 debug github.com/loft-sh/devpod/cmd/agent/workspace.initWorkspace
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:140
15:49:11 debug github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:84
15:49:11 debug github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:60
15:49:11 debug github.com/spf13/cobra.(*Command).execute
15:49:11 debug  /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
15:49:11 debug github.com/spf13/cobra.(*Command).ExecuteC
15:49:11 debug  /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
15:49:11 debug github.com/spf13/cobra.(*Command).Execute
15:49:11 debug  /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
15:49:11 debug github.com/loft-sh/devpod/cmd.Execute
15:49:11 debug  /home/runner/work/devpod/devpod/cmd/root.go:71
15:49:11 debug main.main
15:49:11 debug  /home/runner/work/devpod/devpod/main.go:12
15:49:11 debug runtime.main
15:49:11 debug  /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/proc.go:250
15:49:11 debug runtime.goexit
15:49:11 debug  /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/asm_amd64.s:1594
15:49:11 debug error parsing workspace info: rerun as root: exit status 1
15:49:11 debug done exec
15:49:11 debug done inject
15:49:11 debug done injecting
15:49:11 debug Done InjectAgentAndExecute
15:49:11 debug Done executing up command
15:49:11 debug Done creating devcontainer
15:49:11 fatal exit status 1
agent error: Error trying to reach docker daemon: docker ps: exit status 1
Rerun as root: /home/devpod/.devpod/devpod agent workspace up --workspace-info H4sIAAAAAAAA/+xUXW/bNhT9KwOxR8miqC9LTzNsIdXS2IGjFGiLwaDIS5uLJAoi5aQw/N8H+iNzirRZnvawPVk0z/0451zeHXpU/YPuKAOU7ZDkKENMDVq2yEHD4ZgyXAkRcTeOUuqGMU/dcRCAW0EU4SSClMYYOUiomkOPMuRtVAPemj96Iw7bTnGPqdbAk9EeB0GH2njPNbX3XKzr1VYeMuxQSxtAGeJyLQ2tFQPaor2DGso2sj00evosXvRLB6NmUIMBlJl+gL2DJIeLhKqDdquZ4mDTaTX0R9praZbQKS2N6r+hzJ5/W0uzGaoRU0225o/k1OhoLY2NZT1QI1Vbyga0oU2HMkQwCVycuJiUxM/COCPxF+Sgmmpzr4H/GHHSxzI+CvQd2ZeuvEfoU5J3yOwg1Vli2gImV/m8XM0m5WR1Oyk/2L+2tB7gufip7rk+XUN7aP4Y+I9ijj82aFbcXa+Km8lVfhnEFXuA3iXYxeEz6q748gIUYHtVzCfTsvhUlJ9XZXGTL+7LS4yPmyPo93xarmaL6XW+XE2X+Syfl8Xk490l1k7PBfiqKN9C3kymH4p5vio/377oTLvhlnWDO15XFrbMr4rF/BIgeurbm3Jxnc9fEu9WW38Vj0NOggCHCRlDEKVxgClnFTAhKgJxWqWJCOKgwjRmUHEuIGQB8wOM2RhCGth3rKG/PfrOTy9j/74ZfnVCj25nO9RRs3nDXgdxaujtT4DHbA7i6rGtFeX3y48oQxtjOp153t+v0auVMK7enON7qIFq0N450NvikT/y7U6SLWVGbqX5ZjmqwZzGwN78CcxcSTPtgUNrJK312c3z7ewwea8C4AmYZa43g7F1UfYV/bqbLVa3y8WnYpYv979oozr0x95BlWxpL+HwoC4QKPu6Q8rmrGU7PNn11TOrDm14HFrNN8Ae9NCgDCWJH5JxRHhSEYxJlaYijivALEwjLkQSBAEHwplfQZVSAWPiCww+pEkaCAK245NHb+rpnheEe7kWXlcZj8hPo9wDM/dIaO/8gG7ffE93zGkapwHnPmFh5LO44nEyHoc84AICQlIRV5xgIFEMKaNRCCCYz7hPK+wngv/LdA+E9tb6h6GCvgVzMH/vnHaZ/d7/v2f/I3v2LwAAAP//AQAA//8iACVoYgkAAA== --debug
Use /home/devpod/.devpod/agent/contexts/default/workspaces/cousin as workspace dir
exit status 128
error cloning repository
github.com/loft-sh/devpod/cmd/agent/workspace.CloneRepository
        /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:469
github.com/loft-sh/devpod/cmd/agent/workspace.prepareWorkspace
        /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:213
github.com/loft-sh/devpod/cmd/agent/workspace.initWorkspace
        /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:140
github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
        /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:84
github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
        /home/runner/work/devpod/devpod/cmd/agent/workspace/up.go:60
github.com/spf13/cobra.(*Command).execute
        /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1044
github.com/spf13/cobra.(*Command).Execute
        /home/runner/work/devpod/devpod/vendor/github.com/spf13/cobra/command.go:968
github.com/loft-sh/devpod/cmd.Execute
        /home/runner/work/devpod/devpod/cmd/root.go:71
main.main
        /home/runner/work/devpod/devpod/main.go:12
runtime.main
        /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/asm_amd64.s:1594
error parsing workspace info: rerun as root: exit status 1

github.com/loft-sh/devpod/pkg/agent.InjectAgentAndExecute
        /home/runner/work/devpod/devpod/pkg/agent/inject.go:120
github.com/loft-sh/devpod/cmd.(*UpCmd).devPodUpMachine.func1
        /home/runner/work/devpod/devpod/cmd/up.go:276
runtime.goexit
        /opt/hostedtoolcache/go/1.19.10/x64/src/runtime/asm_amd64.s:1594

Local Environment:

DevPod Version: v1.10.0 Operating System: linux (crostini on chromebook) ARCH of the OS: i386 DevPod Provider:

Cloud Provider: digitalOcean

gdw2 avatar Jul 02 '23 22:07 gdw2

@gdw2 thanks for creating this issue! Mhh, might be a problem with the credentials helper, I guess we would need to do agent-forwarding for the connection there, do you use gpg keys or regular ssh keys? Does it work when using https?

FabianKramm avatar Jul 05 '23 08:07 FabianKramm

I just use ssh keys.

On Wed, Jul 5, 2023 at 2:40 AM Fabian Kramm @.***> wrote:

@gdw2 https://github.com/gdw2 thanks for creating this issue! Mhh, might be a problem with the credentials helper, I guess we would need to do agent-forwarding for the connection there, do you use gpg keys or regular ssh keys? Does it work when using https?

— Reply to this email directly, view it on GitHub https://github.com/loft-sh/devpod/issues/463#issuecomment-1621300878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCLQELTSAYTCDBT43KI3DXOUSARANCNFSM6AAAAAAZ3WCEDQ . You are receiving this because you were mentioned.Message ID: @.***>

gdw2 avatar Jul 06 '23 04:07 gdw2

@FabianKramm Same problem here with v0.2.1 on windows using pagent in unix sock mode for SSH agent. Agent works for DevPod to connect to ssh on host, but the ssh agent doesn't seem to be forwarded into the ssh session so git clone fails on the remote host.

segfly avatar Jul 07 '23 15:07 segfly

@segfly @gdw2 after some discussing we will fallback in such cases to localhost, clone the repo there and then upload it to the server once, this should fix all cases for now, in future we might improve this using agent-forwarding.

FabianKramm avatar Jul 10 '23 14:07 FabianKramm

@FabianKramm So we will need to install git locally? What if I don't have it installed (I would on Linux, but not windows), or if the repo I am working on is massive and I don't have the disk space locally. Not much of a solution for a application meant to enable remote development. (But I can't complain for free support 😄)

segfly avatar Jul 10 '23 15:07 segfly

@segfly @gdw2 yes for now at least if you want to clone via ssh keys that you only have locally. Its a fallback mechanism for now which would work most of the time, but I agree there are cases where this still wouldn't be the perfect solution. As a next step we can build an intermediate step between git has failed remotely and git has failed locally to try git with ssh agent-forwarding remotely.

FabianKramm avatar Jul 12 '23 13:07 FabianKramm