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

Remote SSH connection fails to load direnv environment #20477

Open
1 task done
joshbainbridge opened this issue Nov 10, 2024 · 0 comments
Open
1 task done

Remote SSH connection fails to load direnv environment #20477

joshbainbridge opened this issue Nov 10, 2024 · 0 comments
Labels
bug [core label] remote dev Feedback for remote development servers

Comments

@joshbainbridge
Copy link

joshbainbridge commented Nov 10, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Loading a per-project development environment using direnv does not appear to work on remote servers. Language server (clangd) is not found when using direnv, while it is found if the same development environment is added globally to the server in the .cshrc file.

I have tested using both direct and shell_hook for the load_direnv option on the server settings.json. The shell hook has been added to the .cshrc file.

Zed.log is the same for both direct and shell_hook. Terminals inside of Zed do have the development environment regardless. I believe this is due to the shell hook in the .cshrc file being run as it would any normal shell.

This is the settings.json on the server:

{
  "load_direnv": "direct",
  // "load_direnv": "shell_hook",
  "lsp": {
     "clangd": {
       "binary": {
         "path": "clangd"
       }
     }
   }
}

Server OS is Red Hat Enterprise Linux 9. The server is using a 'tcsh' shell and does not have access to the internet. I am using direnv as a solution to load a local per-project development environment, but please do say if there are other options.

Hope this is helpful. Let me know if there is any more information I can provide. I'd be happy to investigate this more.

Environment

Zed: v0.161.1 (Zed Preview)
OS: macOS 15.1.0
Memory: 32 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
2024-11-10T15:25:27.889405Z [INFO] ========== starting zed ==========
2024-11-10T15:25:27.894364Z [INFO] Opening main db
2024-11-10T15:25:27.897382Z [INFO] Opening main db
2024-11-10T15:25:27.922742Z [INFO] Using git binary path: Some("/Applications/Zed Preview.app/Contents/MacOS/git")
2024-11-10T15:25:27.985935Z [INFO] set environment variables from shell:/bin/zsh, path:/Users/josh/.cargo/bin:/Users/josh/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin
2024-11-10T15:25:28.153783Z [INFO] no tokio runtime found, creating one for Reqwest...
2024-11-10T15:25:28.178931Z [INFO] initializing context server client
2024-11-10T15:25:28.17927Z [INFO] Registering built-in prompt template: content_prompt
2024-11-10T15:25:28.179771Z [INFO] Registering built-in prompt template: project_slash_command
2024-11-10T15:25:28.179839Z [INFO] Registering built-in prompt template: suggest_edits
2024-11-10T15:25:28.179976Z [INFO] Registering built-in prompt template: terminal_assistant_prompt
2024-11-10T15:25:28.180165Z [INFO] No prompt template overrides directory found at /Users/josh/.config/zed/prompt_overrides. Using built-in prompts.
2024-11-10T15:25:28.181839Z [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-11-10T15:25:28.228043Z [INFO] Opening main db
2024-11-10T15:25:28.275989Z [INFO] Opening main db
2024-11-10T15:25:28.284708Z [INFO] Opening main db
2024-11-10T15:25:32.727279Z [ERROR] client:unhandled ssh message name:UpdateProject
2024-11-10T15:25:32.810325Z [ERROR] (remote server) git status process failed: Unknown option: --no-optional-locks
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

2024-11-10T15:25:32.821374Z [ERROR] (remote server) git status process failed: Unknown option: --no-optional-locks
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

2024-11-10T15:25:47.967405Z [ERROR] (remote server) login shell exited with exit status: 1
2024-11-10T15:25:47.971473Z [ERROR] (remote server) Failed to start language server "clangd": failed to spawn command. path: "clangd", working directory: "/path/to/project", args: []
2024-11-10T15:25:47.971653Z [ERROR] (remote server) server stderr: ""
@joshbainbridge joshbainbridge added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Nov 10, 2024
@notpeter notpeter added remote dev Feedback for remote development servers and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] remote dev Feedback for remote development servers
Projects
None yet
Development

No branches or pull requests

2 participants