Open jchirschy opened 3 months ago
@jchirschy thanks for reporting this! It seems the CLI argument is out of date and we only support dot files from a git repo at the moment. I have raised this as a ticket though to implement in the future :)
Nice project! would be great if git repo argument support calls over ssh, for private git repos... git@github.com:user-name/dotfiles.git something like:
devpod up . --provider docker --dotfiles git@github.com:user-name/dotfiles.git
Thanks
@anibal-aguila thanks for reporting your use case, that does looks like it would be common. I'm surprised this fails though, I expected the config SSH_INJECT_GIT_CREDENTIALS
to default to true here and allow you to use the git repo provided your local environment has these git credentials set up. Could you add --debug
to your command and send me the logs so I can see why it fails?
Hi @bkneis, thanks for your quick response, sure here the --debug output. BR,
13:09:15 info Workspace rust-app already exists
13:09:15 debug Acquire workspace lock...
13:09:15 debug Acquired workspace lock...
13:09:15 info Creating devcontainer...
13:09:15 debug Inject and run command: '/nix/store/s92j1iw0g152v546nqr6nk3zrz57q1ab-devpod-0.5.4/bin/devpod' helper ssh-server --stdio --debug
13:09:15 debug Attempting to create SSH client
13:09:15 debug execute inject script
13:09:15 debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.4
13:09:15 debug Run command provider command: sh -c "${COMMAND}"
13:09:15 debug Received line after pong: done
13:09:15 debug SSH client created
13:09:15 debug SSH session created
13:09:15 info Execute SSH server command: zsh -c '/nix/store/s92j1iw0g152v546nqr6nk3zrz57q1ab-devpod-0.5.4/bin/devpod' agent workspace up --workspace-info 'H4sIAAAAAAAA/4RTzW7...' --debug
13:09:15 info No root required, because neither docker nor agent daemon needs to be installed
13:09:15 info Use /home/username-x/.devpod/agent/contexts/default/workspaces/rust-app as workspace dir
13:09:15 debug Created logger
13:09:15 debug Received ping from agent
13:09:15 debug Workspace Folder already exists /home/username-x/loop/labs/acnx/ludus/rust-app
13:09:15 debug Workspace exists, skip downloading
13:09:15 debug Using docker command '/home/username-x/.nix-profile/bin/podman'
13:09:16 debug execute inject script
13:09:16 debug Received line after pong: done
13:09:16 debug done inject
13:09:16 debug done injecting
13:09:16 debug Done InjectAgentAndExecute
13:09:16 debug Injected into container
13:09:16 info Setup container...
13:09:16 debug Attempting to create SSH client
13:09:16 debug Inject and run command: '/usr/local/bin/devpod' helper ssh-server --stdio --debug
13:09:16 debug done exec
13:09:16 debug SSH client created
13:09:16 debug SSH session created
13:09:16 info Execute SSH server command: bash -c '/usr/local/bin/devpod' agent container setup --setup-info 'H4sIAAAAAAAA/+y9C......''
13:09:16 debug Created logger
13:09:16 debug Received ping from agent
13:09:16 debug Start setting up container...
13:09:16 debug Patch etc environment & profile...
13:09:16 debug Run post create commands...
13:09:16 debug Done setting up environment
13:09:16 debug Start DevPod Container Daemon with Inactivity Timeout 300
13:09:16 debug Connection to SSH Server closed
13:09:16 debug Done setting up container
13:09:16 debug Done executing ssh server helper command
13:09:16 debug Connection to SSH Server closed
13:09:16 debug done inject
13:09:16 debug done exec
13:09:16 debug done injecting
13:09:16 debug Done InjectAgentAndExecute
13:09:16 debug Done executing ssh server helper command
13:09:16 debug Done creating devcontainer
13:09:16 info Run 'ssh rust-app.devpod' to ssh into the devcontainer
13:09:16 info Dotfiles git repository git@github.com:username-x/dotfiles-devpod.git specified
13:09:16 debug Cloning dotfiles into the devcontainer...
13:09:16 debug Running command: [/nix/store/s92j1iw0g152v546nqr6nk3zrz57q1ab-devpod-0.5.4/bin/devpod ssh --agent-forwarding=true --start-services=true --user vscode --context default rust-app --log-output=raw --command /usr/local/bin/devpod agent workspace install-dotfiles --repository git@github.com:username-x/dotfiles-devpod.git --debug --debug]
13:09:16 info Adding ssh keys to agent, disable via 'devpod context set-options -o SSH_ADD_PRIVATE_KEYS=false'
13:09:16 info Error adding private keys to ssh-agent: ssh-agent is not started
13:09:16 info Acquire workspace lock...
13:09:16 info Acquired workspace lock...
13:09:16 info execute inject script
13:09:16 info download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.4
13:09:16 info Run command provider command: sh -c "${COMMAND}"
13:09:16 info Received line after pong: done
13:09:17 info Successfully connected to host
13:09:17 info Run container tunnel
13:09:17 info Execute SSH server command: zsh -c '/nix/store/s92j1iw0g152v546nqr6nk3zrz57q1ab-devpod-0.5.4/bin/devpod' agent container-tunnel --workspace-info 'H4sIAAAAAAAA/4RTzW7....' --debug
13:09:17 info No root required, because neither docker nor agent daemon needs to be installed
13:09:17 info Use /home/username-x/.devpod/agent/contexts/default/workspaces/rust-app as workspace dir
13:09:17 info Workspace Folder already exists /home/username-x/loop/labs/acnx/ludus/rust-app
13:09:17 info Using docker command '/home/username-x/.nix-profile/bin/podman'
13:09:17 info execute inject script
13:09:17 info Received line after pong: done
13:09:17 info done inject
13:09:17 info done injecting
13:09:17 info Done InjectAgentAndExecute
13:09:17 info done exec
13:09:17 info Successfully connected to container
13:09:17 info Run outer container tunnel
13:09:17 info Execute SSH server command: bash -c cat /var/run/devpod/result.json
13:09:17 info Execute SSH server command: bash -c su -c "'/usr/local/bin/devpod' helper ssh-server --track-activity --stdio --workdir '/workspaces/rust-app' --debug" 'vscode'
13:09:17 info Successfully parsed result at /var/run/devpod/result.json
13:09:17 info Execute SSH server command: bash -c '/usr/local/bin/devpod' agent container credentials-server --user 'vscode' --configure-git-helper --configure-docker-helper --debug
13:09:17 info Received ping from agent
13:09:17 info Start credentials server
13:09:17 info Wrote docker credentials helper to /usr/local/bin/docker-credential-devpod
13:09:17 info Credentials server started on port 16562...
13:09:17 info Execute SSH server command: bash -c /usr/local/bin/devpod agent workspace install-dotfiles --repository git@github.com:username-x/dotfiles-devpod.git --debug
13:09:17 info Cloning dotfiles git@github.com:username-x/dotfiles-devpod.git
13:09:17 info Cloning into '/home/vscode/dotfiles'...
13:09:18 info ssh: Could not resolve hostname github.com: Name or service not known
13:09:18 info fatal: Could not read from remote repository.
13:09:18 info
13:09:18 info Please make sure you have the correct access rights
13:09:18 info and the repository exists.
13:09:18 info exit status 128
13:09:18 info error cloning repository
13:09:18 info github.com/loft-sh/devpod/pkg/git.CloneRepository
13:09:18 info github.com/loft-sh/devpod/pkg/git/git.go:133
13:09:18 info github.com/loft-sh/devpod/cmd/agent/workspace.(*InstallDotfilesCmd).Run
13:09:18 info github.com/loft-sh/devpod/cmd/agent/workspace/install_dotfiles.go:54
13:09:18 info github.com/loft-sh/devpod/cmd/agent/workspace.NewInstallDotfilesCmd.func1
13:09:18 info github.com/loft-sh/devpod/cmd/agent/workspace/install_dotfiles.go:36
13:09:18 info github.com/spf13/cobra.(*Command).execute
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:916
13:09:18 info github.com/spf13/cobra.(*Command).ExecuteC
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:1044
13:09:18 info github.com/spf13/cobra.(*Command).Execute
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:968
13:09:18 info github.com/loft-sh/devpod/cmd.Execute
13:09:18 info github.com/loft-sh/devpod/cmd/root.go:90
13:09:18 info main.main
13:09:18 info github.com/loft-sh/devpod/main.go:8
13:09:18 info runtime.main
13:09:18 info runtime/proc.go:271
13:09:18 info runtime.goexit
13:09:18 info runtime/asm_arm64.s:1222
13:09:18 info Connection to container closed
13:09:18 info done inject
13:09:18 info done injecting
13:09:18 info Done InjectAgentAndExecute
13:09:18 info Tunnel to host closed
13:09:18 info Error tunneling to container: wait: remote command exited without exit status or exit signal
13:09:18 info Container tunnel exited
13:09:18 info Error running credential server: wait: remote command exited without exit status or exit signal
13:09:18 info done exec
13:09:18 info Process exited with status 1
13:09:18 info run in container
13:09:18 info github.com/loft-sh/devpod/pkg/tunnel.(*ContainerHandler).Run.func2
13:09:18 info github.com/loft-sh/devpod/pkg/tunnel/container.go:105
13:09:18 info runtime.goexit
13:09:18 info runtime/asm_arm64.s:1222
13:09:18 info tunnel to container
13:09:18 info github.com/loft-sh/devpod/pkg/tunnel.(*ContainerHandler).Run
13:09:18 info github.com/loft-sh/devpod/pkg/tunnel/container.go:111
13:09:18 info github.com/loft-sh/devpod/cmd.(*SSHCmd).jumpContainer
13:09:18 info github.com/loft-sh/devpod/cmd/ssh.go:221
13:09:18 info github.com/loft-sh/devpod/cmd.(*SSHCmd).Run
13:09:18 info github.com/loft-sh/devpod/cmd/ssh.go:120
13:09:18 info github.com/loft-sh/devpod/cmd.NewSSHCmd.func1
13:09:18 info github.com/loft-sh/devpod/cmd/ssh.go:74
13:09:18 info github.com/spf13/cobra.(*Command).execute
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:916
13:09:18 info github.com/spf13/cobra.(*Command).ExecuteC
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:1044
13:09:18 info github.com/spf13/cobra.(*Command).Execute
13:09:18 info github.com/spf13/cobra@v1.6.1/command.go:968
13:09:18 info github.com/loft-sh/devpod/cmd.Execute
13:09:18 info github.com/loft-sh/devpod/cmd/root.go:90
13:09:18 info main.main
13:09:18 info github.com/loft-sh/devpod/main.go:8
13:09:18 info runtime.main
13:09:18 info runtime/proc.go:271
13:09:18 info runtime.goexit
13:09:18 info runtime/asm_arm64.s:1222
@anibal-aguila thanks for that. Which provider are you using? The error seems to be 13:09:18 info ssh: Could not resolve hostname github.com: Name or service not known
. Can you check if the remote host can resolve DNS? i.e. devpod ssh rust-app
then try nslookup github.com
Hi @bkneis, thanks for it! I tried to anonymize the previous logs and don't see the domain was changed. Here the full picture about my attempt and the connection dropped over ssh. Seems that devpod doesn't capture the HostName value from ~/.ssh/config file.
BR,
When doing
devpod up --dotfiles
It seems that referencing a local git folder either by :/absolutpath/to/folder
orfile:///absolutepath/to/folder
is actually usinghttps:///absolutpath/to/folder
orhttps://file:///absolutepath/to/folder
(using --debug flag). Did I miss something or it is possible to add this feature ? Thanks for you help