The problem I’m having is I tried to update my packages using dbt deps and I got an error stating: The process cannot access the file because it is being used by another process: ‘dbt_packages\dbt-expectations-0.8.2\integration_tests’ and I have no idea how to fix this?
I am using dbt-sqlserver and my IDE is VsCode. I have tried dbt clean but it doesnt get rid of two of the folders. To delete those I have found that I need to exit vscode then re-open in which I can delete them.
I have put my packages yaml down below.
- package: dbt-labs/codegen
- package: calogica/dbt_date
- package: calogica/dbt_expectations
- package: dbt-labs/metrics
- package: Datavault-UK/dbtvault
Does the error message say which process is accessing the file? What extensions do you have installed in VS Code? It sounds like something else is getting its hooks into the files which is causing problems when dbt deps tries to overwrite the folders with updated files.
So I was able to get out of the error by deleting my repo restarting my computer then cloning my repo again then dbt deps worked. This is the second time that this has happened to me, and I think you’re on the right train of thought with it being something to do with the extensions.
This an error I also received when shifting around the packages and always seems to have to do with integration tests:
[WinError 32] The process cannot access the file because it is being used by another process: ‘dbt_packages\dbt_metrics-1.4.0\integration_tests’ 15:03:05 Traceback (most recent call last): File “C:\Users\jb_admin\AppData\Local\Programs\Python\Python310\lib\shutil.py”, line 816, in move os.rename(src, real_dst) PermissionError: [WinError 5] Access is denied: ‘dbt_packages\dbt_metrics-1.4.0’ → ‘dbt_packages\metrics’.
Here is the list of extensions I am using:
C/C++ Extension Pack
Code Spell Checker
dbt Power User
IntelliCode API Usage
jupyter Cell Tags
Jupyter Notebook renderers
jupyter slide show
markdown preview Github sytling
material icon theme
sql database projects
From this issue on the VS Code repo, it looks like this article might help (haven’t tried it myself). It looks like it uses Process Explorer to identify which process is holding the file lock, which might get down to the extension level
I was having this exact problem and solved it by disabling the dbt Power User extension, and then running dbt deps.
Interesting! Maybe this is a sibling to Duplicate dbt_utils folder when running dbt deps · Issue #4372 · dbt-labs/dbt-core · GitHub, which also seems to have power user as a culprit.