VSCode rust-analyzer SSH to server. Connection disposed of, Code: -32097

Hello. I'm using VSCode and the pre-release version of rust-analyzer to work on a Rocket project on my remote server. It uses some remote SSH plugins to work directly on the server with all the files there. I was wondering if anyone else has done this and had any problems with it.
I keep getting piles of errors and I've finally found rust-analyzer's logout and found it is having connection issues. I worked on another project in the same way and didn't have any problems.
Here is the ouput I'm seeing:


[Info  - 8:42:03 PM] Connection to server got closed. Server will restart.
[ERROR rust_analyzer::main_loop] FetchBuildDataError:
cargo check failed

[Info  - 8:45:07 PM] Connection to server got closed. Server will restart.
[ERROR rust_analyzer::main_loop] FetchBuildDataError:
cargo check failed

[Info  - 8:47:11 PM] Connection to server got closed. Server will restart.
[Error - 8:49:53 PM] Client Rust Analyzer Language Server: connection to server is erroring. Shutting down server.
[Error - 8:49:53 PM] Connection to server got closed. Server will not be restarted.
[Error - 8:49:53 PM] Stopping server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 8:49:53 PM] Stopping server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

Now, from what I can see, the ssh plugin creates a connection fo the server and runs most things where. I had me install the rust analyzer plugin in the remote environment, I guess because the rust compiler is there. Like I said, it worked before, although then I didn't need the pre-release version. I needed to upgrade it because Rocket wants everything to be so bleeding edge new.

Any ideas what's going wrong? With it not connecting, it keeps displaying all sorts of errors in the code because of Rockets liberal usage of macros. Thanks in advance for any help any of you can provide.

did you try on another (presumably smaller) project? can you run cargo build or cargo check successfully from a shell? did a release version (as opposed to preview) work?

also, what ssh plugin are you using? rust analyzer via the default vscode ssh remote works fine for me.

Hello, thanks for getting back to me. The project is basically a brand new hello world program, soI can't get much simpler than that. The ssh module is Remote - SSH. Also, I had to move to a pre-release version as it wouldn't work with the nightly build of rust, which was required by Rocket to even function. At least, it finally started to work for a bit when I upgraded it. Something about how Rocket was dealing with macros and such.
In any event, I found out that despite the plethora of errors it kept going on about, if I gave the debug run command, it fired up and then I could see if there were real errors. It seems all the error's it was displaying when it wasn't running were mainly the macro stuff. When it's running, everything seems to work. I think the issue I was having came from when I was editing between runs. So now I'm just editing the code until I think I've got it working and run to check for errors. It's kind of annoying though that a number of features are missing though as code hints and completion aren't really working.

did you check the logs on your remote machine? if the system has resource limits like ram or cpu time, the rust analyzer server process might get killed by the system. this should rarely happen given the development environment typically doesn't have such restrictions, but you could check just in case.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.