Stream: t-compiler/rust-analyzer

Topic: Failed to deserialize InitializeParams


lqd (Dec 23 2020 at 10:42, on Zulip):

what kind of information would an issue need about "Failed to deserialize InitializeParams: invalid type: map, expected a boolean" on startup in vscode ? there were a few of those issues recently but none for the boolean vs map combination. is there a workaround maybe ? like downgrading the r-a server or plugin ?

matklad (Dec 23 2020 at 10:50, on Zulip):

@lqd the first thing to look at would be logs: RA_LOG=rust-analyzer=info

lqd (Dec 23 2020 at 10:52, on Zulip):

I'll try to extract the logs

lqd (Dec 23 2020 at 10:57, on Zulip):

where would I find these ? somewhere on the filesystem or one of vscode output panes ?

matklad (Dec 23 2020 at 10:58, on Zulip):

image.png

lqd (Dec 23 2020 at 11:01, on Zulip):

the "rust analyzer language server trace" one is empty, the "rust analyzer language server" one looks like https://gist.githubusercontent.com/lqd/9eab48bde9dfb8a402fa6d0f1d7f0be5/raw/3483c51a5ff8133637ff143a8887029f61fdb107/gistfile1.txt but that didn't change with the RA_LOG env variable so I doubt it's what you asked for ? :)

matklad (Dec 23 2020 at 11:03, on Zulip):

I'd guess the env var is not picked up?

lqd (Dec 23 2020 at 11:04, on Zulip):

you know windows and env vars ^^ but it's there in all my terminals

Laurențiu (Dec 23 2020 at 11:05, on Zulip):

Try starting Code from a terminal if you're not doing that already

lqd (Dec 23 2020 at 11:05, on Zulip):

I am doing that, from a terminal which sees the env var

lqd (Dec 23 2020 at 11:06, on Zulip):

maybe a good old reboot will fix it :thumbs_up:

matklad (Dec 23 2020 at 11:06, on Zulip):

tbh, I don't exactly know how to debug this further

matklad (Dec 23 2020 at 11:06, on Zulip):

serde's error... isn't really helpful

lqd (Dec 23 2020 at 11:06, on Zulip):

right

lqd (Dec 23 2020 at 11:07, on Zulip):

maybe trying to repro by building r-a locally

matklad (Dec 23 2020 at 11:07, on Zulip):

Ideally, we need something like https://github.com/serde-rs/serde/issues/1908 here

Laurențiu (Dec 23 2020 at 11:07, on Zulip):

There's also https://github.com/rust-analyzer/rust-analyzer/issues/6983#issuecomment-750132243 (but notice the different error)

matklad (Dec 23 2020 at 11:08, on Zulip):

we might want to plug https://docs.rs/serde_path_to_error/0.1.4/serde_path_to_error/

matklad (Dec 23 2020 at 11:10, on Zulip):

@lqd if you feel like building locally, the relvant bit of code is this: https://github.com/rust-analyzer/rust-analyzer/blob/0dec77abe744e5c4910b9ff0ce0c443cee425040/crates/rust-analyzer/src/bin/main.rs#L107-L108

lqd (Dec 23 2020 at 11:10, on Zulip):

I'll try rebooting in case there's some stray vscode process not picking the var, or holding up monday's update or something. if it's just the server, that should be debuggable locally more easily than if it needs a whole other plugin

lqd (Dec 23 2020 at 11:10, on Zulip):

alright, thank you, I'll try and report back ^^

Laurențiu (Dec 23 2020 at 11:22, on Zulip):

matklad said:

we might want to plug https://docs.rs/serde_path_to_error/0.1.4/serde_path_to_error/

https://github.com/rust-analyzer/rust-analyzer/pull/7019

Laurențiu (Dec 23 2020 at 11:23, on Zulip):

Untested, tho'

lqd (Dec 23 2020 at 11:36, on Zulip):

ah but is it RA_LOG=info instead of RA_LOG=rust-analyzer=info ? there's more logs with that but it is still the same InitializeParams data I pasted earlier, so trying to get more info from serde is still necessary; building locally it is, possibly with the above PR

lqd (Dec 23 2020 at 12:07, on Zulip):

ok it doesn't repro on master

lqd (Dec 23 2020 at 12:16, on Zulip):

and it doesn't repro either on 2020-12-21 (which I assume is v0.2.424) ... at least a local build is a workaround

Laurențiu (Dec 23 2020 at 14:27, on Zulip):

There's an extra patch on the release branch, maybe you got a binary that doesn't contain it? https://github.com/rust-analyzer/rust-analyzer/commit/5e2935e0b3bdcfaf95b4b5f86d4a0c4aec7588f5

lqd (Dec 23 2020 at 14:31, on Zulip):

I think this one is in the release & tag I've tried https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-12-21

lqd (Dec 23 2020 at 14:31, on Zulip):

weird

lqd (Dec 23 2020 at 14:32, on Zulip):

especially if others have some similar issues, albeit not the exact same error

Joshua Nelson (Dec 25 2020 at 22:53, on Zulip):

I just ran into the same issue

Joshua Nelson (Dec 25 2020 at 22:54, on Zulip):

Laurențiu Nicola said:

There's an extra patch on the release branch, maybe you got a binary that doesn't contain it? https://github.com/rust-analyzer/rust-analyzer/commit/5e2935e0b3bdcfaf95b4b5f86d4a0c4aec7588f5

I'll try that, thanks

Joshua Nelson (Dec 25 2020 at 22:55, on Zulip):

yup, installing from nightly fixed it :) thanks!

Last update: Jul 26 2021 at 12:30UTC