-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Stuck at 'rust_analyzer: -32801: waiting for cargo metadata or cargo check' #10910
Comments
Does running Though I guess it gets stuck at calling cargo metadata |
@Veykril hey that worked! The error still appears when opening a project file but it disappears after a few seconds. Do I need to run that command in every project now? How can I prevent this or why is this happening in first place? Thanks in advance for the help. |
Uuh, running that command shouldn't fix the problem for you 😅 I was more interested in seeing whether running cargo check manually would also fail for you or not. This seems rather odd since all that r-a usually does is running cargo metadata and cargo check. |
@Veykril you are right, I'm still getting the same message in my other projects. I'm running out of ideas. |
When you ran |
Same setup and same issue as @tranvnhan :) Seems to be kindof working though. |
@khjcph @tranvnhan hey it's the same error I'm facing still! There's a few projects where even |
I have to learn to live with it 😅. No clue what happens. |
Can anyone share some code where this happens? |
I got the same error when I open a Rust project whether I use either Nvim or Emacs But rust-analyzer is working fine in both of them, function like go-to-definition and auto-completion works fine. It just shows the error in the beginning. |
Is the project open source by any chance? A repro for this is needed to make this actionable. |
I get the same error when i open project with nvim, this is my configuration. Looks like |
@champly the workaround that @Veykril provides partially works. I'm still dealing with the error as well when opening some of my projects, it fades away after a few seconds. AFAIK it has something to do with recent |
It seems that rust-analyzer could not work if Also, in VS Code it seems failed if your workspace contains serde source tree -- in that case the following error is logged in the Rust Analyzer Language Server output panel:
Deleting serde from my workspace and relaunching VS Code solves that problem. After that it failing on compiling the Rust Analyzer Language Server output panel:
Deleting egui and eframe_template from my workplace and relaunch VS Code solves that problem. After that Rust Analyzer Language Server output panel even doesn't show in the VS Code and all seems right... but still not working. Rust Analyzer Language Server Trace output panel is always empty (what the difference from Rust Analyzer Language Server?) Rust Analyzer Client contains following output: Rust Analyzer Client``` INFO [18.03.2022, 20:36:53]: Extension version: 0.2.975 INFO [18.03.2022, 20:36:53]: Using configuration { cargoRunner: null, runnableEnv: null, inlayHints: { enable: true, renderColons: true, chainingHints: true, maxLength: 25, parameterHints: true, typeHints: true, hideNamedConstructorHints: false }, server: { path: null, extraEnv: null }, trace: { server: 'off', extension: false }, debug: { engine: 'auto', sourceFileMap: { '/rustc/': '${env:USERPROFILE}/.rustup/toolchains//lib/rustlib/src/rust' }, openDebugPane: false, engineSettings: {} }, assist: { exprFillDefault: 'todo', importGranularity: 'crate', importEnforceGranularity: false, importPrefix: 'plain', importGroup: true, allowMergingIntoGlobImports: true }, cache: { warmup: true }, callInfo: { full: true }, cargo: { autoreload: true, allFeatures: false, unsetTest: [ 'core' ], features: [], runBuildScripts: true, useRustcWrapperForBuildScripts: true, noDefaultFeatures: false, target: null, noSysroot: false }, checkOnSave: { enable: true, allFeatures: null, allTargets: true, command: 'check', noDefaultFeatures: null, target: null, extraArgs: [], features: null, overrideCommand: null }, completion: { addCallArgumentSnippets: true, addCallParenthesis: true, snippets: { 'Arc::new': { postfix: 'arc', body: 'Arc::new( |
vim-lsp LogNote: a lot of duplicate requests have been omitted here
It seems as though this error is caused by the client making requests shortly after startup, before |
I'm seeing this issue in VSCode with the egui project here: https://github.com/emilk/egui As a hack I have needed to create a {
"rust-analyzer.cargo.target": "disabled"
} because there doesn't seem to a way to disable rust-analyzer for a single project? If I don't disable it then I can't build egui manually while rust-analyzer is perpetually holding the build lock (and I really don't want to disable rust-analyzer entirely because it's working fine for other projects). Enabling verbose tracing I don't really see any obvious clue about what's going wrong. It seems to behave the same if I open the top-level Manually running Versions: Visual Studio Code About:
|
Okey, so poking a bit further (I figured I'd try just hacking away big chunks of the egui repo that I wasn't working on to see if I could get rust-analyzer working) I found that they have a
and if I restore everything I tried deleting in the repo and just delete that file it seems to workaround this issue for me. |
A common error found while using emacs + lsp-mode + rust-analyzer is that on startup I receive the following logs: ``` LSP :: Error from the Language Server: waiting for cargo metadata or cargo check (Unknown error) [4 times] ``` This looks similar to rust-lang#10910, and as some people mention, everything works well once `cargo metadata` finishes running. I stubmled accross a [helpful comment] which made me think that it might be worth waiting for startup to finish, before attempting to respond to LSP requests. [helpful comment](https://github.com/rust-lang/rust-analyzer/blob/d382e24a11c8706b201c8437894506d191691334/crates/rust-analyzer/src/main_loop.rs#L567-L568)
A common error found while using emacs + lsp-mode + rust-analyzer is that on startup I receive the following logs: ``` LSP :: Error from the Language Server: waiting for cargo metadata or cargo check (Unknown error) [4 times] ``` This looks similar to rust-lang#10910, and as some people mention, everything works well once `cargo metadata` finishes running. I stumbled accross a [helpful comment](https://github.com/rust-lang/rust-analyzer/blob/d382e24a11c8706b201c8437894506d191691334/crates/rust-analyzer/src/main_loop.rs#L567-L568) which made me think that it might be worth waiting for startup to finish, before attempting to respond to LSP requests.
Having this issue as well, on Emacs with |
I ran into the same issue. However, was able to solve that by updating rust to 1.63. |
I get this in eclipse corrosion on a 'hello-world' rust example, attached. Eclipse workspace: Project:
However, when i tried to get the version of the rust-analyzer to submit this comment I found that when i used the 'Download rust analyzer' button on the 'Eclipse / Preferences / Rust' window it downloaded Which is correct, because
Then I restarted Eclipse and it immediately complained about my rust config being incorrect, which because it was pointing at So I changed it, as below: And now the My issue is likely a bug in Eclipse Corrosion, as it should download and extract files that have the correct file extensions for the operating system being used. I'll try and find an issue on an appropriate repository and link to this comment. EDIT: actually there is probably also a rust-analyzer distribution/artifacts/packaging issue, but I'm not sure who was responsible for creating the file that eclipse corrosion downloaded. Does anyone know if Hope this helps someone, if it did, please 'like/thumbs-up' this comment so I know I'm not wasting my time writing up this solution. |
sigh seems like I spoke to soon: It still hangs. seems like it's just getting stuck on something and then becomes unresponsive. Same workspace, same files, no changes. Just restarted Eclipse. IMHO, the packaging issue on windows still exists and I raised eclipse-corrosion/corrosion#410 to track any changes in Eclipse Corrosion that might be needed. |
After switching back to the IDE window a few minutes later I found this:
This error is logged every time you restart the IDE (for my 'hello-world' example above). I also get this error:
|
I'm not sure the
The "waiting for cargo metadata or cargo check" is also not necessarily a problem, unless doesn't stop happening once rust-analyzer has settled down. Ideally the IDE would give you a way of retrying the request or do that automatically. |
yes, but only from inside eclipse. it's uncommon and unhelpful on windows to have an PE executable without .exe extension.
as yes, it's just a .gz, not a .tar.gz. In which case the code that decompresses it should add the
It doesn't 'settle down' on some files at all, and it's a problem if it's not consistent too. Like sometimes the 'outline' view works, other times it does not. To the end-user it appears random. |
same error got on doom emacs+m1 Mac+LSPrustic |
Same error happened in:
Got messages:
|
i have the same problem in ubuntu:
but I realized that it is a problem related to the crates, I have a project with two crates, rust-analyzer gets stuck when I import the bincode library in one of my crates, I am trying to make a minimum reproducible example |
@Ivan-Sanchez-Diaz I suspect it's just |
my bad, I made some changes in the network adapter that affected my |
Same error have been occurring in QtCreator since 8.0 https://bugreports.qt.io/browse/QTCREATORBUG-27856 |
@installgentoo the QtCreator report seems unrelated. Depending on whichever problem you're running into, consider running |
in the latest log that i ran with debug i get
and then analyzer crashes. Notably everything works on 7, where QtCreator apparently communicated synchronously to the server(or ignored "Initialized" response, i'm not quite sure yet), creator displays a little "cargo check" progress popup. And everything indeed fetches and works. |
it happened in my projs too. noticed that the 'serde' you mention, i just write 'log' or 'log4j' before 'serde' in cargo.toml 's dependcies, and it works |
I am seeing this error using I created a new project: I see:
in my As for
|
For me this isn't fixed in Eclipse with It's certainly better, but it still dies and in Eclipse 2/ Corrosion the end user experiance is that the IDE shows a 'Language Background Server Job' that never completes, task manager shows multiple instances of 'rust-analyzer.exe' and hover-over always fails with two errors in the IDE log:
and
Version details:
|
@hydra that sounds like an unrelated issue. But I don't understand, does Eclipse kill the server if it doesn't respond in 500 ms to a request? |
Nope, it just gets stuck in task manager with zero-cpu usage, if you kill the task it spawns new ones, some of which complete depending on which files you have open. It doesn't seem to matter which files I have open though, it always does it sooner or later. The root issue is likely not in Eclipse, but in rust analyzer, that said if there's a way to get logs of the communication between the two programs then I might be able to help get them so that someone taking charge of this issue can look at them to see if there's anything wrong. If this is possible then please can you either tell me how to get such logs (e.g. running a debug version of rust-analyzer and/or passing extra args to it) or point me at the docs on how I might go about this? |
🍿
Yeah, see |
Something to try for those people on VS Code coming off Google:
For me, these things were the last things I did before it started working. Not sure if all steps are necessary... I think step 2 perhaps the crucial one but I don't have time to try and reproduce right-now. |
Switching to pre-release version worked for me |
I'm opening a project directory and rust-analyzer seems to be stuck at loading. I checked if perhaps was a project issue but the error persists in both big (5+ dependencies) and small projects (using 1 dependency). I'm using neovim v0.7.0-dev in Ubuntu. Any suggestion of how to solve this issue? Thanks in advance.
rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer d9b2291 2021-11-29 stable
rustc version: (eg. output of
rustc -V
)rustc 1.56.1 (59eed8a2a 2021-11-01)
The text was updated successfully, but these errors were encountered: