Skip to content
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

Request textDocument/* failed #13006

Closed
Chralt98 opened this issue Aug 12, 2022 · 9 comments
Closed

Request textDocument/* failed #13006

Chralt98 opened this issue Aug 12, 2022 · 9 comments
Labels
A-ty type system / type inference / traits / method resolution I-panic S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@Chralt98
Copy link

I always getting following language server error notifications for the rust-analyzer.

Request textDocument/semanticTokens/range failed.

Request textDocument/inlayHint failed.

Request textDocument/semanticTokens/full failed.

The Output debug print is the following.

Panic context:
> 
version: 0.3.1162-standalone (634cfe3d7 2022-08-07)
request: textDocument/codeAction CodeActionParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/Users/test/project/src/lib.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 91,
            character: 51,
        },
        end: Position {
            line: 91,
            character: 51,
        },
    },
    context: CodeActionContext {
        diagnostics: [],
        only: None,
    },
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
}

thread 'Worker' panicked at 'overflow depth reached', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/chalk-recursive-0.83.0/src/fixed_point/stack.rs:51:13
stack backtrace:
   0: std::panicking::begin_panic
   1: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
   2: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
   3: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
   4: chalk_recursive::solve::SolveIteration::solve_iteration
   5: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
   6: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
   7: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
   8: chalk_recursive::solve::SolveIteration::solve_iteration
   9: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  10: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  11: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  12: chalk_recursive::solve::SolveIteration::solve_iteration
  13: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  14: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  15: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  16: chalk_recursive::solve::SolveIteration::solve_iteration
  17: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  18: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  19: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  20: chalk_recursive::solve::SolveIteration::solve_iteration
  21: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  22: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  23: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  24: chalk_recursive::solve::SolveIteration::solve_iteration
  25: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  26: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  27: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  28: chalk_recursive::solve::SolveIteration::solve_iteration
  29: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  30: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  31: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  32: chalk_recursive::solve::SolveIteration::solve_iteration
  33: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  34: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  35: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  36: chalk_recursive::solve::SolveIteration::solve_iteration
  37: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  38: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  39: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  40: chalk_recursive::solve::SolveIteration::solve_iteration
  41: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  42: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  43: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  44: chalk_recursive::solve::SolveIteration::solve_iteration
  45: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  46: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  47: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  48: chalk_recursive::solve::SolveIteration::solve_iteration
  49: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  50: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  51: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  52: chalk_recursive::solve::SolveIteration::solve_iteration
  53: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  54: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  55: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  56: chalk_recursive::solve::SolveIteration::solve_iteration
  57: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  58: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  59: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  60: chalk_recursive::solve::SolveIteration::solve_iteration
  61: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  62: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  63: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  64: chalk_recursive::solve::SolveIteration::solve_iteration
  65: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  66: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  67: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  68: chalk_recursive::solve::SolveIteration::solve_iteration
  69: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  70: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  71: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  72: chalk_recursive::solve::SolveIteration::solve_iteration
  73: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  74: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  75: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  76: chalk_recursive::solve::SolveIteration::solve_iteration
  77: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  78: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  79: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  80: chalk_recursive::solve::SolveIteration::solve_iteration
  81: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  82: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  83: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  84: chalk_recursive::solve::SolveIteration::solve_iteration
  85: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  86: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  87: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
  88: chalk_recursive::solve::SolveIteration::solve_iteration
  89: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
  90: chalk_recursive::fulfill::Fulfill<I,Solver>::prove
  91: chalk_recursive::fulfill::Fulfill<I,Solver>::solve
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I use the lastest rust-analyzer extension from VSCode.

I didn't installed the binary with homebrew.

What can I do to prevent that rust-analyzer spamms that error notifications?

@Veykril Veykril added the A-ty type system / type inference / traits / method resolution label Aug 12, 2022
@WilliamVenner
Copy link

WilliamVenner commented Aug 12, 2022

Has been happening constantly for maybe 2 weeks now? I even get it on other machines in every crate I work on.

@Chralt98
Copy link
Author

It happens since I work with multiple crates.

@lnicola
Copy link
Member

lnicola commented Aug 12, 2022

There's already some known chalk bugs resulting in this, but we'll need some sample code that shows the problem.

@WilliamVenner
Copy link

These errors happen with all sorts of crates, not just chalk.

#12843 #10084 #12046

Notably it happens even without changing Cargo.toml, and persists after restarting the extension host.

@lnicola
Copy link
Member

lnicola commented Aug 12, 2022

It's a bug in the chalk crate, which we use for trait solving. It gets into an infinite loop. #12897 is one example. Code using the RustCrypto (aes etc.) crates is another. The crash will happen every time, even if you restart the extension, since the types it's trying to solve are the same.

You can try reducing CHALK_OVERFLOW_DEPTH or CHALK_SOLVER_MAX_SIZE (they're environment variables, you can set them in rust-analyzer.server.extraEnv), but that doesn't always help.

@lnicola lnicola added the S-unactionable Issue requires feedback, design decisions or is blocked on other work label Aug 12, 2022
@spookyvision
Copy link
Contributor

is it possible to demote these errors from "popup" to "log only"? They are pretty irritating and not user actionable anyway

@WilliamVenner
Copy link

I agree with above, and I would happily enable any kind of telemetry if it would aid with fixing these. They happen all the time for me.

@Veykril Veykril added the I-panic label Dec 6, 2023
@szmarczak
Copy link

This also happens on brand new project created via cargo (using vscode with rust-analyzer):

Panic context:
> 
version: 0.3.2078-standalone (fa0032624 2024-08-17)
request: textDocument/semanticTokens/full SemanticTokensParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/szmar/Desktop/kubus-demo/hello/src/main.rs",
            query: None,
            fragment: None,
        },
    },
}

thread 'Worker' panicked at D:\a\rust-analyzer\rust-analyzer\crates\salsa\src\input.rs:91:32:
no value set for CompressedFileTextQuery(FileId(2))
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
   2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::fetch
   3: <DB as base_db::SourceDatabase>::compressed_file_text
   4: <base_db::FileTextQuery as salsa::plumbing::QueryFunction>::execute
   5: salsa::Cycle::catch
   6: salsa::derived_lru::slot::Slot<Q,MP>::evict
   7: salsa::derived_lru::slot::Slot<Q,MP>::read
   8: <salsa::derived_lru::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
   9: <DB as base_db::SourceDatabase>::file_text
  10: salsa::Cancelled::catch
  11: rust_analyzer::handlers::request::handle_semantic_tokens_full
  12: std::panicking::try
  13: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 12:47:42 PM] Request textDocument/semanticTokens/full failed.
  Message: request handler panicked: no value set for CompressedFileTextQuery(FileId(2))
  Code: -32603 
Panic context:
> 
version: 0.3.2078-standalone (fa0032624 2024-08-17)
request: textDocument/semanticTokens/range SemanticTokensRangeParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/szmar/Desktop/kubus-demo/hello/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 0,
            character: 0,
        },
        end: Position {
            line: 3,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\rust-analyzer\src\global_state.rs:635:40:
no entry found for key
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
   2: core::panicking::panic_display
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:262
   3: core::option::expect_failed
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\option.rs:1995
   4: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
   5: rust_analyzer::lsp::from_proto::file_range
   6: rust_analyzer::handlers::request::handle_semantic_tokens_range
   7: std::panicking::try
   8: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 12:47:42 PM] Request textDocument/semanticTokens/range failed.
  Message: request handler panicked: no entry found for key
  Code: -32603 
Panic context:
> 
version: 0.3.2078-standalone (fa0032624 2024-08-17)
request: textDocument/semanticTokens/range SemanticTokensRangeParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    partial_result_params: PartialResultParams {
        partial_result_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/szmar/Desktop/kubus-demo/hello/src/main.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 0,
            character: 0,
        },
        end: Position {
            line: 3,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\rust-analyzer\src\global_state.rs:635:40:
no entry found for key
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:72
   2: core::panicking::panic_display
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\panicking.rs:262
   3: core::option::expect_failed
             at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\option.rs:1995
   4: rust_analyzer::global_state::GlobalStateSnapshot::file_line_index
   5: rust_analyzer::lsp::from_proto::file_range
   6: rust_analyzer::handlers::request::handle_semantic_tokens_range
   7: std::panicking::try
   8: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 12:47:50 PM] Request textDocument/semanticTokens/range failed.
  Message: request handler panicked: no entry found for key
  Code: -32603 

@Veykril
Copy link
Member

Veykril commented Aug 22, 2024

That panic (should be) fixed on master (so by next monday). AS for the original panic posted here, given its a chalk panic I'll close this as there isnt too much for us to do there right now

@Veykril Veykril closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution I-panic S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

6 participants