Rust Analyzer fails to run, Potential bug in rust-analyzer-2024-10-14
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
When starting Zed, rust analyzer fails to start with the error message as in the screenshot below.
The error message is
Language server error: rust-analyzer
failed to spawn command. path: "/Users/ashwin/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2024-10-14", working directory: "/Users/ashwin/GitHub/rust/gd32f4_rs_test", args: []
-- stderr--
I tried to debug what was going on a little - I thought that perhaps the issue was with rust analyzer itself. So I found out that the rust "/Users/ashwin/Library/Application Support/Zed/languages/rust-analyzer/" folder had a previous version of the binary in it. I added the following in .zed/settings.json to switch to rust-analyzer-2024-10-07.
{
"lsp": {
"rust-analyzer": {
"binary": {
"path": "/Users/ashwin/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2024-10-07",
"arguments": ["--no-log-buffering"]
}
}
}
}
And things seem to be working. Perhaps there is a bug in rust-analyzer-2024-10-14?
Environment
Zed: v0.156.2 (Zed) OS: macOS 14.7.0 Memory: 16 GiB Architecture: x86_64
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
I think this is https://github.com/zed-industries/zed/pull/17885 and if you remove all the settings and check out the logs, you'll see what exactly Zed tries to autodetect.
To keep downloading the binaries as before, I use
"lsp": {
"rust-analyzer": {
"binary": {
"ignore_system_version": true
}
}
}
I also encountered this issue, how can I fix it?
@Zwishing Does this help? What is in your logs?
I think this is #17885 and if you remove all the settings and check out the logs, you'll see what exactly Zed tries to autodetect.
To keep downloading the binaries as before, I use
"lsp": { "rust-analyzer": { "binary": { "ignore_system_version": true } } }
I actually just tried this and it doesn't seem to work and results in the same error.
I had the same problem.
I had an old version in:
/Users/jruz/Library/Application Support/Zed/languages/rust-analyzer
so renamed rust-analyzer-2024-10-07 to rust-analyzer-2024-10-14
And is working for now
I had the same issue and used this interim solution which makes Zed to use the rust-analyzer binary from the toolchain. The issue somehow appears to be related with the download/install process.
https://github.com/zed-industries/zed/issues/20648#issuecomment-2486683186
@zwishing Does this help? What is in your logs? it works now
Did receive the same error message. I noticed that I also got 2 versions of rust-analyzer in the specified directory. The newer one wasn't even set as executable (on linux). It's size also was just around 10M vs. 44MB of the older version. Simply removed the newer version and restarted Zed. Zed re-downloaded the rust-analyzer and removed the old version. The freshly received rust-analyzer binary is now also executable and has a size of 44MB. My guess is that the binary didn't fully downloaded the first time which would explain why it couldn't be used by zed.
I changed the shell to fish and got the same error, removing the rust-analyzer binary from Zed folder did the trick, after Zed redownloaded it, everything worked
just
rm -rf /Users/xxx/Library/Application\ Support/Zed/languages/rust-analyzer/*
I happened to close zed when it is updating rust-analyzer
just
rm -rf /Users/xxx/Library/Application\ Support/Zed/languages/rust-analyzer/*I happened to close zed when it is updating rust-analyzer
This worked for me also
just
rm -rf /Users/xxx/Library/Application\ Support/Zed/languages/rust-analyzer/*I happened to close zed when it is updating rust-analyzer
yeah this worked for me,
zed should give option to update the lsp
just rm -rf /Users/xxx/Library/Application\ Support/Zed/languages/rust-analyzer/* I happened to close zed when it is updating rust-analyzer
My OS is fedora and this worked for me (delete /home/user/.local/share/zed/languages/rust-analyzer/*) seems like the newer analyzer download failed (the executable size before delete is 20M and after delete is come to 40M and worked normally)
just
rm -rf /Users/xxx/Library/Application\ Support/Zed/languages/rust-analyzer/*I happened to close zed when it is updating rust-analyzer
my rust analyzer was somehow corrupted, doing this solved for me. thanks!