zed
zed copied to clipboard
Copilot can't be started: oneshot canceled
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
Github Copilot no longer works for me in Zed. I see that is inactive, and click "sign-in" . After a few moments, I see an error popup
Copilot can't be started: oneshot canceled
I have tried:
- clicking
Reinstall copilot - resigning into my github account
- reinstalling zed (via brew)
without success
Environment
Zed: v0.136.2 (Zed) OS: macOS 14.2.1 Memory: 8 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
[INFO] Node runtime install_if_needed
[INFO] starting language server. binary path: "/Users/john/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node",
working directory: "/", args: ["/Users/john/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
[ERROR] crates/lsp/src/lsp.rs:357: cannot read LSP message headers
[ERROR] crates/lsp/src/lsp.rs:379: Broken pipe (os error 32)
[ERROR] crates/lsp/src/lsp.rs:773: server shut down
and I have also seen before:
[ERROR] crates/inline_completion_button/src/inline_completion_button.rs:493: copilot hasn't started yet
Following https://github.com/zed-industries/zed/issues/6954 I have attempted to solve this by
- uninstall zed from brew
brew uninstall zed
brew cleanup -s
- remove copilot related cache
rm -rf ~/.config/github-copilot
rm -rf ~/Library/Application\ Support/Zed/copilot
- manually install zed from the official aarch64 .dmg from https://zed.dev/download
The issue persists; copilot will not turn on.
Did this just start happening with a specific version, @spaceunifyfifty?
Did this just start happening with a specific version, @spaceunifyfifty?
I am not sure. I feel like I first noticed this a few weeks ago.
same here. Tried reinstalling the app and clearing ~/.config/github-copilot & Application Support/, but no effect. Any news on this @spaceunifyfifty @JosephTLyons ?
I'm facing the same issue on a linux build
@JosephTLyons any update on this or recommended steps to fix? Still do not have copilot working.
is there any updates on this? I got the same issue on NixOS
is there any updates on this? I got the same issue on NixOS
some info from the console when trying to sign in to copilot:
2024-07-12T03:42:28+03:00 ERROR util] crates/lsp/src/lsp.rs:357: cannot read LSP message headers
[2024-07-12T03:42:28+03:00 ERROR util] crates/inline_completion_button/src/inline_completion_button.rs:493: copilot hasn't started yet
[2024-07-12T03:42:28+03:00 ERROR util] crates/lsp/src/lsp.rs:773: server shut down
[2024-07-12T03:42:28+03:00 ERROR util] crates/lsp/src/lsp.rs:379: Broken pipe (os error 32)
I'm having the same issue running NixOS, Zed 0.141.3.
I have this issue on Arch Linux, running preview 144.2.
EDIT: I was able to fix this problem by deleting ~/.local/share/zed/node/node-v18.15.0-linux-x64/bin/node and instead symlinking /usr/bin/node in it's place. Doing this allowed copilot to connect with out Node shutting down.
cd ~/.local/share/zed/node/node-v18.15.0-linux-x64/bin && rm ./node && ln -s /usr/bin/node ./node
EDIT 2: This seems to have resolved many other problems, including the JSON LSP never working (for settings.json).
@143mailliw
Glad you got it working. If anyone finds an analogous solution for MacOS please post.
i made a script for this because my node wasn't at /usr/bin/node
https://gist.github.com/dezren39/234c8693555fba7d4234f147da5a7553
For nixos user having this issue, doing this worked for me: 1: Delete the node provided by zed:
rm .local/share/zed/node/node-v22.5.1-linux-x64/bin/node
2: Symlink the node path, for my system I used:
ln -s ~/.nix-profile/bin/node ./node
Special thanks to @143mailliw for the idea
@k3yss this works, but is it rebuild safe? Is there a better way of doing this via configuration.nix rather than running the commands manually
but is it rebuild safe?
I think so, as I have been using this for the past few revision.
Is there a better way of doing this via configuration.nix rather than running the commands manually
There is a new zed-fhs in the nixpkgs-unstable maybe that solves the problem, although I have yet to test it.
cc https://github.com/NixOS/nixpkgs/issues/309662
but is it rebuild safe?
I think so, as I have been using this for the past few revision.
Is there a better way of doing this via configuration.nix rather than running the commands manually
There is a new
zed-fhsin thenixpkgs-unstablemaybe that solves the problem, although I have yet to test it.
I just tried to search for zed-fhs on unstable channel and there is no such package
@vec715 I think if you the original package zed it has the fhs features builtin, take a look at this https://github.com/NixOS/nixpkgs/pull/339852
I believe it may be related to stale node configurations and for some users, issues with node18, but without steps to reproduce I'm going to go ahead close this as unactionable.
To troubleshoot this you may wish to verify explicitly what version of node Zed is using. Check your PATH and which node / which npm, and ps aux |grep copilot. For example, I briefly experienced this issue while I had a non-default node18 installation temporarily configured in my path. Node 18 is already EOL (security updates only) and will be completely unsupported on 2025-04-30.
If you are experiencing this with a current zed release and node >= 20 please open a clean issue with as many details as possible so we can best try and troubleshoot and reproduce exactly what you are seeing.
After updating to v0.180.2, I encountered the same error: "oneshot canceled".
Here are the logs:
2025-04-02T23:13:58.618953+03:00 [INFO] starting language server process. binary path: "/usr/local/bin/node", working directory: "/", args: ["/Users/user/Library/Application Support/Zed/copilot/node_modules/@github/copilot-language-server/dist/language-server.js", "--stdio"]
2025-04-02T23:13:58.659705+03:00 [ERROR] cannot read LSP message headers
2025-04-02T23:13:58.659841+03:00 [ERROR] Broken pipe (os error 32)
2025-04-02T23:13:58.659928+03:00 [ERROR] server shut down
I ran the command manually to investigate:
"/usr/local/bin/node" "/Users/user/Library/Application Support/Zed/copilot/node_modules/@github/copilot-language-server/dist/language-server.js" --stdio
And got this output:
Node.js 20.x is required to run GitHub Copilot but found 19.0.0
So the issue was that Copilot's language server requires Node.js 20.x, but my /usr/local/bin/node pointed to Node.js 19.
Even though I had Node.js 22 installed via nvm, Zed was still using the old system path. To fix it, I updated the symlink to point to my active Node.js version:
ln -sf $(which node) /usr/local/bin/node
Or you can simply update the Node.js version installed at /usr/local/bin/node to 20.x or higher.
After that, everything worked again.
See also:
- https://github.com/zed-industries/zed/issues/27908
Which will be fixed by:
- https://github.com/zed-industries/zed/pull/27912