Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devpod up command fails on NixOS-WSL #1238

Closed
walbi-malbi opened this issue Sep 1, 2024 · 2 comments
Closed

devpod up command fails on NixOS-WSL #1238

walbi-malbi opened this issue Sep 1, 2024 · 2 comments
Labels

Comments

@walbi-malbi
Copy link

What happened?

devpod up command does not complete successfully because devpod cannot find the shell during startup.

❯ devpod up github.com/microsoft/vscode-remote-try-node --ssh-config ./sshconfig --ide none --debug
11:16:44 info Workspace vscode-remote-try-node already exists
11:16:44 debug Acquire workspace lock...
11:16:44 debug Acquired workspace lock...
11:16:44 info Creating devcontainer...
11:16:44 debug Adding ssh keys to agent, disable via 'devpod context set-options -o SSH_ADD_PRIVATE_KEYS=false'
11:16:44 debug Inject and run command: '/nix/store/kkcznh61m89yx5flzcn9mwvdarq6l6a7-devpod-0.5.19/bin/devpod' helper ssh-server --stdio --debug
11:16:44 debug Attempting to create SSH client
11:16:44 debug Execute command locally
11:16:44 debug SSH client created
11:16:44 debug SSH session created
11:16:44 debug Forwarding ssh-agent using /home/walbi/.ssh/wsl2-ssh-agent.sock
11:16:44 info Execute SSH server command: wrapper -c '/nix/store/kkcznh61m89yx5flzcn9mwvdarq6l6a7-devpod-0.5.19/bin/devpod' agent workspace up --workspace-info 'H4sIAAAAAAAA/5RT72/bNhD9V4b7LJmS45/61jnBaqyrh8wZsBVFcSZPNhOK1HiUbCfw/z5Qchx36zD0G3m84917994L7J1/4holrbzeagsFiJ2rSOzRbLQYKGprp4R0NtAhsFBUYmOCuJSxaFk6RamnygVKgz+m1il6yxg8srOQvHWC4gW0ggK+XQkJNP94TjfZcHIDCdRahsYTFLALoeZCCFeT3Xqsd4OtDrtmg8wUeCBdJabTaV5mw/F4OCSUI1TTWV6OJ3IyHtJNOVNIiOVmnI8zmt5MR3OclxnOETOazIdZKUWlpXfsyvAfGONA3rVakY+YLFZxMuXkE3lIwNVBO8vx6Xa1+Pnu/suv79bv47VF01ylnhJYfny3WC9/X67/+LJe/nK3elhD8XI6nRKoUO60jaSdEtCKrjpZZykWs2t8T+tWh3uqHevg/PGKpZ6bjpX/BXVKQHrCOPtaV8QBqxoKGGbDUZrN0pt8nY+K8ajIb/6EBAxyeGBSl4x5muXrbFjkk2I0ihln7US4vXhih1h2S+3C2YDakl84W+pthCAvpzPKj05FDUWyHYdFHI0WrqrQqpgFxSc4orc/aMsBjYHPEUDDwVX6GS8b6MHGEx0CWe7jn4CDJwqsFUVO9uhp0LHCNRmTyh11G/qcAFMI2m75dS+6wm0cr5J+cOG0Y1hRK19xsXjEFll6XYeO3iJP81m6aYxhOnZk1xh2UMDguuyrP3oDnRLALdkQIRgn0UABwTedCPsfhNUHwcF5Ek9P8tnuJnk1mx8P49I8Szuv9q1C/9fETHCa9r5Os8F4kM/FRlvRRyAB5fbWOFQP9x++rSDjypDy7lwhPBlCJhavhaLtv4UEtH0kGX7ScW2KbNBo+G1uOpDsdd0bwRDz9T1CPWO7mOp1ywWUaLhXa7fsbi8JSKNXb77r/HLxyb8N+ePD8sPt3X3f9Bx7v/pt/VXg+137NwAAAP//AQAA//9V15T0VwUAAA==' --debug
11:16:44 info Exit error: start command: exec: "wrapper": executable file not found in $PATH
11:16:44 info start command: exec: "wrapper": executable file not found in $PATH
11:16:44 debug Connection to SSH Server closed
11:16:44 debug Done creating devcontainer
11:16:44 debug Done executing ssh server helper command
11:16:45 fatal Process exited with status 1
run agent command
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:129
runtime.goexit
        runtime/asm_amd64.s:1695

What did you expect to happen instead?

The devpod up command completes successfully.

Local Environment:

  • DevPod Version: v0.5.19
  • Operating System: linux (NixOS-WSL)
  • ARCH of the OS: AMD64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know?

The issue described above occurs only on NixOS-WSL.

In NixOS-WSL, wrapper is provided as the default shell, but this file is placed in a location that is not included in the system PATH.

❯ getent passwd walbi
walbi:x:1000:100::/home/walbi:/nix/store/yjwj3x64ki9b9s53p8qvwvgz84bn6ywn-wrapped-zsh/wrapper
❯ echo $SHELL
/nix/store/i3lac62jigipwhsrjd10zr9z8ihfqmwb-zsh-5.9/bin/zsh

I checked the getUserShell function in devpod, and it seems to extract the shell from /etc/passwd.

output, err := exec.Command("getent", "passwd", currentUser.Username).Output()

Because of this, the error message "Exit error: start command: exec: 'wrapper': executable file not found in $PATH" occurs.

While this issue is not a fault of devpod, would it be possible to modify devpod to find the shell using the SHELL environment variable if available?

@pascalbreuninger
Copy link
Member

pascalbreuninger commented Sep 1, 2024

Hi @walbi-malbi, thanks for reporting the issue

While this issue is not a fault of devpod, would it be possible to modify devpod to find the shell using the SHELL environment variable if available?

Sounds like a good solution, thanks for digging in 👍

@pascalbreuninger
Copy link
Member

@walbi-malbi This issue should be fixed with the next stable release, will close. Let us know if it didn't work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants