Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

RLS server crashes #26

Closed
durka opened this issue Jan 18, 2017 · 38 comments
Closed

RLS server crashes #26

durka opened this issue Jan 18, 2017 · 38 comments

Comments

@durka
Copy link
Contributor

durka commented Jan 18, 2017

I keep getting "[ERROR] The Rust Language Service server crashed 5 times in the last 3 minutes. The server will not be restarted." Is there any way I can get output from the server to see what might be happening?

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017

I get this after opening this project, a reddit user pointed to this one as well.

@jonasbb
Copy link
Contributor

jonasbb commented Jan 18, 2017

Try setting this variable to true. https://github.com/jonathandturner/rls_vscode/blob/master/src/extension.ts#L10
Then you should see something in the output view.

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@chriskrycho
Copy link

I see it when trying to do anything in lightning as well.

@jonasbb
Copy link
Contributor

jonasbb commented Jan 18, 2017

@durka It would print something to the second instance, not the first one. In the output view on the right hand side there is a drop down field. Does it contain "Rust Language Service" (2nd instance)?

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017

I'm not sure which dropdown you mean. Here's the window:

Do you mean the ... button in the top right? That only contains "Show opened editors" (which is only lib.rs) and "Close all". Selecting "View->Debug console" from the menu, it is also empty.

@sophiajt
Copy link

@durka - what happens if you run the rls by hand with a cargo run?

I was able to open cellsplit and libbig working on my side, so I wonder if these issues are coming from somewhere related.

I'm using:

rustc 1.16.0-nightly (ff591b6dc 2017-01-15)

Maybe there's a rustc mismatch?

You can get a little better debugging by setting:

let DEV_MODE = true;

In the VSCode plugin, on line 10 in extension.ts.

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@sophiajt
Copy link

@durka - yeah, it doesn't print anything out when it starts up, but if it's not crashing immediately that's at least something 😅

VS Code compiles the plugin when you hit debug. The TypeScript just compiles fast enough that it doesn't seem to be doing anything before it starts the second VSCode instance.

RLS uses log and env_logger. If you add RUST_LOG=info to your environment and restart VSCode in that environment, you'll see some of the debug info. Maybe that'll be enough to tip us off to what's going wrong.

@sophiajt
Copy link

Not sure if the OS X version makes a difference. I'm guessing not so long as stuff like node is up to date.

(I'm on macOS 10.12.2)

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@jonasbb
Copy link
Contributor

jonasbb commented Jan 18, 2017

@durka Is there any text in the Output window of the second VS Code instance? In the menu View > Output

@sophiajt
Copy link

MANY messages are being SEND FROM the extension host! SEND during 1sec: message_count=318, total_len=318

I haven't seen this before, but it sounds a bit ominous. Is this with the logger turned on?

@sophiajt
Copy link

@durka

Just to be doubly sure the RLS works, does it work for any other projects? Is it just this one that's giving you trouble.

(You can also run the unit tests on the RLS with RUST_TEST_THREADS=1 cargo test in the rls directory if you're wondering if the rls is working)

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@sophiajt
Copy link

Did you set the RLS_ROOT to point to the rls checkout, by chance? I was just thinking that you might see crashes like that if it was trying to run rls but not going down the cargo run path.

@durka
Copy link
Contributor Author

durka commented Jan 18, 2017 via email

@sophiajt
Copy link

huzzah! I'm crossing my fingers that was it. Definitely let us know.

@durka
Copy link
Contributor Author

durka commented Jan 19, 2017

That may have been it? I pinned the rls_vscode directory and ran cargo build --manifest-path=$RLS_ROOT/Cargo.toml --release there (so I could see the progress in terminal instead of having VS Code lock up the whole machine). Then I re-ran the extension in VS Code and it immediately stops at line 179 of node_modules/vscode-jsonrpc/lib/messageReader.js:

                    throw new Error('Header must provide a Content-Length property.');

Should I open a separate issue for that?

@nrc
Copy link
Member

nrc commented Jan 19, 2017

That is a generic error which basically just means that something other than the LSP data got written to stdout. Did you add a println or anything to debug?

@durka
Copy link
Contributor Author

durka commented Jan 19, 2017 via email

@sophiajt
Copy link

@durka do you have RUST_LOG set to a value by chance? I noticed yesterday that this was enough to cause the 'Header must provide a Content-Length property.' issue. Hopefully, we can fix that.

But yes, please file a separate issue and we'll track that down.

@durka
Copy link
Contributor Author

durka commented Jan 20, 2017 via email

@durka
Copy link
Contributor Author

durka commented Jan 20, 2017 via email

@sophiajt
Copy link

@durka - should we close this one? It feels like there are a few things we could do to improve the documentation.

Actually, if you can remember them, can you list the things you needed to do to get it to work so we can add it to the docs and help other people who hit some of the same issues?

@durka
Copy link
Contributor Author

durka commented Jan 23, 2017

@jonathandturner the two keys were (1) make sure a rustup override is set in the rls_vscode dir and (2) make sure RUST_LOG is not set (which required modifying the code because I don't know how to clear VS Code's cache of such things).

@HaronK
Copy link

HaronK commented May 12, 2017

Hi. Today after rustup update I've got the same issue. In the output window I got the following message:

thread 'main' panicked at 'called "Result::unwrap()" on an "Err" value: ErrorImpl { code: Message("missing field 'experimental'"), line: 0, column: 0 }', /checkout/src/libcore/result.rs:859 note: Run with 'RUST_BACKTRACE=1' for a backtrace. [Error - 12:16:48 AM] Connection to server got closed. Server will not be restarted.

Is there a fix for this?

@nrc
Copy link
Member

nrc commented May 14, 2017

This is probably rust-lang/rls#312, we are currently waiting for the fix to land in Rustup. If you build from source and use the latest nightly Rust, this should be fixed already.

@nrc
Copy link
Member

nrc commented Jun 21, 2017

Seems like the first issue is resolved now and the later one probably also

@nrc nrc closed this as completed Jun 21, 2017
@josephlr josephlr mentioned this issue Jun 28, 2017
@mirandadam
Copy link

Hi everyone. I see that this issue is closed since June, but I am getting the "The Rust Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted." message all the time.

I am running only nightly at this time (the stable toolchain is not even installed). I have checked rust-lang/rls#312 and I found no hint of what may be going on.

Environment: windows running vscode 1.16.1, rls plugin version 0.2.3 and rustup show gives:
Default host: x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)
rustc 1.22.0-nightly (01c65cb15 2017-09-20)

What did I miss?

Thanks,
Daniel

@Xanewok
Copy link
Member

Xanewok commented Sep 22, 2017 via email

@mirandadam
Copy link

rustup run nightly rls --version
rls-preview 0.122.0-nightly (7221e38 2017-09-14)

Yes, I started the project with "cargo new myprojectname --bin", and there is a Cargo.toml file.

The actual folder used by vscode is the project root (Cargo.toml, Cargo.lock, src/, target/, .gitignore and .vscode/ are at the root of the EXPLORER tree).

@nrc
Copy link
Member

nrc commented Sep 24, 2017

@mirandadam have a look at https://github.com/rust-lang-nursery/rls/blob/master/debugging.md, you should try enabling logging to try and get some more data about what is happening.

@mirandadam
Copy link

@nrc and @Xanewok, thanks for the replies. Will get more data tomorrow.

@mirandadam
Copy link

Still couldn't get back to working on this. I shouldn't have commited to a 'deadline' on monday, sorry. Will provide the data when I have it.

Xanewok pushed a commit to Xanewok/rls-vscode that referenced this issue Mar 27, 2019
@bcdady
Copy link

bcdady commented Jul 27, 2019

@mirandadam have a look at https://github.com/rust-lang-nursery/rls/blob/master/debugging.md, you should try enabling logging to try and get some more data about what is happening.

I enabled RLS logging, and it generated 5 new rls###.log files, but they're all empty.

rls --version works as expected from the vs code terminal, but the extensions continues to throw rather cryptic errors. Please suggest any other troubleshooting / diagnostic steps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants