rust-analyzer: failed to write request: Broken pipe (os error 32)rust-analyzermacro-error

/// Instructions supported by the generic Name Registry program
#[derive(Clone, BorshSerialize, BorshDeserialize, PartialEq)]
pub enum AggregatorInstruction {
    /// Accounts:
    ///   0. [writable] The aggregator to initialize
    ///   1. [sign] Owner
    ///   2. [] Rent sysvar
    ///   3. [] Clock sysvar
    Initialize(Config),
    /// Accounts:
    ///   0. [writable] The aggregator
    ///   1. [sign] Oracle
    ///   2. [] Clock sysvar
    Submit { timestamp: Timestamp, value: Value },
}

it show some error

failed to write request: Broken pipe (os error 32)rust-analyzermacro-error
failed to write request: Broken pipe (os error 32)rust-analyzermacro-error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 15
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

idk if tomorrow means fix will ship this Monday or next, but to whomst’d’ve it may’ve concerned, the temporary fix is:

rustup default nightly-2021-11-12

to undo:

rustup default nightly
rustup uninstall nightly-2021-11-12

(obviously not hurrying anyone anywhere, btw)

I’ll sort it out tomorrow!

Having the same problem in VS Code with rust-analyzer. Will prefer to stay on stable and not upgrade to nightly, so there is no fix for me yet.

Hi. I’m still seeing this error in v0.2.853 when using the crate https://crates.io/crates/builder-pattern with just the example code.

1. you `rustup update` your stable

2. Ctrl-Shift-P > Rust Analyzer: Show RA Version shows `rust-analyzer version: 183ef048f 2021-11-22 stable` (that's the actual rust-analyzer binary that the `matklad.rust-analyzer` VS Code extension downloads separately). If not, close **all** your VS Code windows, it will try to update on next open.

3. `cargo clean` your project

I went through all your steps but had to add another one, even though VS Code showed the version you described in step 2:

  1. Close all VS Code windows and open them again.

Edit: I took the liberty to post this on Stack Exchange as there is there are too few Rust questions on Stack Exchange: https://stackoverflow.com/questions/70079983/rust-analyzer-failed-to-write-request-broken-pipe-os-error-32/70079984

@Sword-Smith we were downgrading the nightly, and that has since been resolved in #10769 and released yesterday. We can all return to the current nightly now. If you are currently having a problem with stable rustc, which is 1.56.1, it’s either a regression for the old ABI or an unrelated problem altogether.

Please make sure:

  1. you rustup update your stable
  2. Ctrl-Shift-P > Rust Analyzer: Show RA Version shows rust-analyzer version: 183ef048f 2021-11-22 stable (that’s the actual rust-analyzer binary that the matklad.rust-analyzer VS Code extension downloads separately). If not, close all your VS Code windows, it will try to update on next open.
  3. cargo clean your project

and then post the particular error you are getting.

I also encountered this error. My system was VSCode + WSL. I made a mistake of using WSL on Windows FileSystem, but then I came to know about the Remote-WSL extension. I switched VSCode to Ubuntu 20.04 filesystem(WSL) and then error was no more. Weird things happen if VSCode is used on Windows Filesystem.

I referred this link for getting the Extension idea. Follow this if you are using WSL + VSCode: https://harsimranmaan.medium.com/install-and-setup-rust-development-environment-on-wsl2-dccb4bf63700

Edit 2/12/2021: I think using / not using Windows Filesystem doesn’t make a difference and using Remote WSL Extension may fix nothing This is how I resolved it

  1. Uninstalled rust-analyzer extension v0.2.834 (latest)
  2. did rustup update and rustup default nightly Current rustc version rustc 1.59.0-nightly (48a5999fc 2021-12-01)
  3. Installed RA version 0.2.826 (1 version prior), still didnt work, uninstalled it
  4. Installed RA Version 0.2.817 (2 versions prior)
  5. Restarted VSCode, everything worked.

Also I am using a macro which uses proc macro (borsh) under the hood

Just encountered the same problem as @Sword-Smith, I believed it happened just after I updated to the latest version of VSCode. I ran rustup update and then quit VSCode and restarted it and the error messages went way (not sure if the rustup update was necessary or if fully restarting VSCode would have sufficed).

TvT