-
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
Server gets stuck, apparently due to broken Cargo metadata #6589
Comments
Same thing happening to me. Doesn't matter what I do it just blocks saying that it's waiting for cargo metadata or cargo check. Closing all files doesn't do anything. |
@mathemaphysics I'm currently dealing with the same issue. Did you were able to solve it? |
@bluretrece It turns out that there's a command that gets blocked by a request for user info. It's a cargo subcommand. I'll look it up in my history and post. |
@mathemaphysics please, I'd appreciate it a lot! rust-analyzer is still getting stuck in all of my projects. I opened an issue describing the bug last night, but still got no responses whatsoever. |
I am also getting this error, disabling, uninstalling, reinstalling, etc do not help |
I am also getting this error and also tried to disabling, uninstalling, reinstalling, and all of that. It didn't solve the problem |
We need a reproduction here to be able to work on this. |
Btw I believe I finally fixed this by running |
I finally found a solution that worked for me, and what did the trick was to open the project with a root as the rust project I'm working on. Before I opened two directories up because the rust project is part of a large mono repo project. |
To whoever is losing hours of debugging time puzzled about this: I struggled too and saw some threads which spanned for months where people were lost. I too lost a couple of hours on this stupid thing. Turns out, the only problem is that
This is not a problem technically related to rust-analyzer. But from an user experience standpoint, rust-analyzer expects cargo clippy to be available. I think it would be better if it could display an informative message or hint after cargo's error mesage. Something along the lines of :
This would save unadvised users hours of grief. In my personal case, I was having the same problem with a project that uses a Devcontainer. So with Devcontainers, you have a Dockerfile that defines your environment and you develop from inside it... I decided to base my Devcontainer off Thanks in advance, and hope this answer can be useful to someone. |
11891: Better error message on Flycheck Error message (from: unactionable error message if we are using `clippy` as the checker) r=Veykril a=flipbit03 I have commented on this [S-unactionable issue](#6589) that the Flycheck error message should maybe provide a hint about what tool it actually runs. Searching on some places on the Internet I've found multiple people, including myself, losing copious amounts of time on the same issue. So I've decided to make this very small PR :-) From an user experience standpoint, the current error message is unhelpful to the end user, because the end user does not know exactly what it needs to check/fix (outdated, broken, or missing `cargo clippy`). In my own case, `cargo clippy` was actually missing altogether (developing off `rust:1.59.0-bullseye` official Docker image). Thanks in advance! Co-authored-by: Cadu <cadu.coelho@gmail.com>
I'm running into a similar error while working on rustc itself. I tried deleting the build cache, restarting the r-a server, and restarting VS Code, without success. Formatting is working, but this error message keeps appearing:
and no errors are being displayed in the UI (even though my code is incorrect). I have clippy installed for all toolchains via rustfmt (though I guess not the custom toolchain used by Note that go-to-def, find refs, and type inlays are all working. |
Can you try the nightly version of r-a? That one should show you the actual error message |
Aha, the issue is that it's trying to use
I think this is an issue on x.py's end since its shebang requests EDIT: It turns out that there's already an issue for this: rust-lang/rust#71818. The issue with r-a can be circumvented with this: rust-lang/rustc-dev-guide#1335 |
neither |
Can you also try the nightly version of r-a? That one should show you the actual error message. There isn't much we can do here without a reproduction otherwise. I'll go ahead and close this issue as there is not much we can do, and we improved the error output for most cases. |
On pre-release I got
and on VSCode output: Looks like on of the subcommands is |
Looks like you set your |
So I've run an issue a few times now over the last few weeks where my cargo check commands in the terminal get stuck for a very long time (sometimes minutes) blocking on "waiting for file lock on package cache". I just had this happen to me again, and decided to dig in a little. I now think this might be happening when RA tries to read my
Cargo.toml
file just as I'm editing it. This gets it into an error state, like this:After this, it looks like it eventually recover, but it's taking very long to do so (maybe some timeout?) -- and all the while it appears to be holding the package cache file lock.
The text was updated successfully, but these errors were encountered: