vscode-dbt-power-user icon indicating copy to clipboard operation
vscode-dbt-power-user copied to clipboard

Documentation Editor does not release lock on DuckDB file

Open killickm opened this issue 7 months ago • 2 comments

Expected behavior

After using the Documentation Editor, dbt commands and database access should succeed.

Actual behavior

Commands fail with IO error (see below), and the database cannot be accessed until the extension or window is restarted.

When using dbt-duckdb, the documentation editor retains the connection/puts a lock on the .duckdb file, disabling all other interactions with the database (such as dbt run, or attempting to open the database in another program)- even some features within the documentation editor fail, e.g. auto-populating an 'accepted_values' test with unique values from the database.

Behaviour/error is similar to that described in issue #1184

Steps To Reproduce

  1. Create dbt project with the dbt-duckdb adapter and the database location within project directory
  2. Define a source and a model (e.g. use an arbitrary csv)
  3. Run the model
  4. Open documentation editor
  5. Next to 'Columns' click 'sync with database'
  6. Re-run the model; fails with IO error

Log output/Screenshots

Runtime Error
  IO Error: File is already open in 
  C:\Users\<username>\AppData\Local\miniforge3\envs\<envname>\pythonw.exe (PID 18696)

Operating System

Microsoft Windows [Version 10.0.26100.3476]

dbt version

1.9.3

dbt Adapter

dbt-duckdb v1.9.2

dbt Power User version

0.55.13

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

killickm avatar Apr 11 '25 01:04 killickm

@killickm is this still an issue?

anandgupta42 avatar May 17 '25 01:05 anandgupta42

@anandgupta42 checked just now, yes, still an issue. Currently using Power User for dbt v 0.57.0

killickm avatar Jun 03 '25 04:06 killickm