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

SSH Provider fails to set up agent when default shell is fish #966

Closed
ItsMeBrianD opened this issue Mar 16, 2024 · 6 comments · Fixed by loft-sh/devpod-provider-ssh#24
Closed
Assignees

Comments

@ItsMeBrianD
Copy link

What happened?
On a fresh copy of DevPod, I set up the SSH Provider using all default options.

image

I was presented with this error:

[08:01:44] info Waiting for devpod agent to come up...
[08:01:44] debug Inject Error: fish: Unsupported use of '='. In fish, please use 'set INSTALL_DIR "/tmp/devpod"'.
INSTALL_DIR="/tmp/devpod"
^~~~~~~~~~~~~~~~~~~~~~~~^

EOF
[08:01:47] debug execute inject script
[08:01:47] debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.4
[08:01:47] debug Run command provider command: ${SSH_PROVIDER} command
[08:01:47] debug done exec
[08:01:47] debug done inject
[08:01:47] debug done injecting
[08:01:47] debug Inject Error: fish: Unsupported use of '='. In fish, please use 'set INSTALL_DIR "/tmp/devpod"'.
INSTALL_DIR="/tmp/devpod"
^~~~~~~~~~~~~~~~~~~~~~~~^

EOF

What did you expect to happen instead?

I expected DevPod to start up correctly

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

From any DevPod instance, attempt to SSH to a Linux machine that has the fish default shell

Local Environment:

  • DevPod Version: [use devpod version] v0.5.4%
  • Operating System: mac
  • ARCH of the OS: arm64

DevPod Provider:

  • Local/remote provider: ssh

Anything else we need to know?

@pascalbreuninger
Copy link
Member

Hi @ItsMeBrianD, thanks for opening the issue. Did you symlink /bin/sh to /bin/fish (or wherever fish is installed) by chance?

@ItsMeBrianD
Copy link
Author

ItsMeBrianD commented Mar 18, 2024

On the remote host, I did not, fish is only at /usr/bin/fish

@pascalbreuninger
Copy link
Member

I'm asking because we run the command with sh -c, not sure why it's executed in the fish shell

@ItsMeBrianD
Copy link
Author

Here's some more system detail:
image

image

Let me know if there's anything else that would help track this down, happy to help however I can

@pascalbreuninger
Copy link
Member

@ItsMeBrianD I can reproduce the issue, I'm just not entirely sure where the problem lies. Will take another look but for now it's rather low priority tbh

@Crocmagnon
Copy link

Crocmagnon commented Mar 31, 2024

I'm also affected:

What happened?
I created an SSH provider, using a remote machine which uses fish shell. The agent isn't properly injected.

What did you expect to happen instead?
The agent is properly injected, starts and the workspace opens in the selected IDE.

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

  1. Create an SSH provider using a remote machine on which the default login shell for the SSH user is fish
  2. Create a workspace using this provider. I used https://github.com/microsoft/vscode-remote-try-go for the repo
  3. Start the workspace

Debug logs:

[11:07:54] info Workspace vscode-remote-try-go already exists
[11:07:54] debug Acquire workspace lock...
[11:07:54] debug Acquired workspace lock...
[11:07:54] info Creating devcontainer...
[11:07:54] debug Inject and run command: '/tmp/devpod/agent' helper ssh-server --stdio --debug
[11:07:54] debug Attempting to create SSH client
[11:07:54] debug execute inject script
[11:07:54] debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.4
[11:07:54] debug Run command provider command: ${SSH_PROVIDER} command
[11:07:55] debug done exec
[11:07:55] debug done inject
[11:07:55] debug done injecting
[11:07:55] debug Inject Error: fish: Unsupported use of '='. In fish, please use 'set INSTALL_DIR "/tmp/devpod"'.
INSTALL_DIR="/tmp/devpod"
^~~~~~~~~~~~~~~~~~~~~~~~^

EOF

It tries to inject in a loop, until:

[11:11:18] error Try enabling Debug mode under Settings to see a more verbose output
[11:11:18] fatal error retrieving container status: fish: Unknown command: /tmp/devpod/agent
fish: 
'/tmp/devpod/agent' agent workspace status --workspace-info 'xxx'
^~~~~~~~~~~~~~~~~~^
exit status 127

Local Environment:

  • DevPod Version: v0.5.4
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:

  • Local/remote provider: ssh

Anything else we need to know?

Possible workaround before the fix: use bash as login shell.

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

Successfully merging a pull request may close this issue.

6 participants