Skip to content

[BUG] LSP panics during incremental compile #879

@dataders

Description

@dataders

Describe the bug

community slack thread

User reports

[In the VSCE], after saving a model file, the extension will occasionally hang in the While analyzing, live error detection is paused state, thereby rendering the extension unusable.
I've attached a screenshot of my dbt LSP output from the latest time this bug has occurred. The issue appears to be the following:

thread 'tokio-runtime-worker' panicked at crates\dbt-db\src\db.rs:227:13:
expected schema by fqn
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@TIHan, we don't yet have a repro for this, perhaps you can sketch out a scenario where this might be thrown so I can better narrow things down with the user? Below is as far as I was able to get looking at the code.

as I spelunk this error message introduced in https://github.com/dbt-labs/fs/pull/5370, crates\dbt-db\src\db.rs:227:13 points to the below error message within the remove_table_schema() function. remove_table_schema() is invoked inside of with_invalidated_unique_ids() as part of deep cloning the db?

let Some(_) = self.schemas_by_fqn.remove(&fqn) else {
          // Sanity check for invariants
          panic!("expected schema by fqn");
        };

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingvscePertains to the VS Code Extension / Language Server

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions