AltimateAI / vscode-dbt-power-user

This extension makes vscode seamlessly work with dbt™: Auto-complete, preview, column lineage, AI docs generation, health checks, cost estimation etc
https://www.altimate.ai
MIT License
471 stars 94 forks source link

File lock #334

Open pkanter opened 1 year ago

pkanter commented 1 year ago

Expected behavior

I run dbt clean and dbt deps to update my packages. Updates happen without error.

Actual behavior

When I run dbt clean and then dbt deps, it appears that there's a conflict with the dbt_project_evaluator package. I've not seen this previously.

Steps To Reproduce

With dbt power user enabled, when I run dbt clean and then dbt deps, it appears that there's a conflict with the dbt_project_evaluator package. I've not seen this previously. If I disable power user, and then run dbt deps, my packages install as expected. I then enable dbt power user and go on with my day.

Log output/Screenshots

  File "c:\users\...\fivetran_dbt_integrated\.venv\lib\site-packages\dbt\deps\base.py", line 117, in _install
    connection_exception_retry(download_untar_fn, 5)
  File "c:\users\...\fivetran_dbt_integrated\.venv\lib\site-packages\dbt\utils.py", line 616, in _connection_exception_retry
    return fn()
  File "c:\users\...\fivetran_dbt_integrated\.venv\lib\site-packages\dbt\deps\base.py", line 129, in download_and_untar
    system.untar_package(tar_path, deps_path, package_name)
  File "c:\users\...\fivetran_dbt_integrated\.venv\lib\site-packages\dbt\clients\system.py", line 497, in untar_package
    dbt.clients.system.rename(downloaded_path, desired_path, force=True)
  File "c:\users\...\fivetran_dbt_integrated\.venv\lib\site-packages\dbt\clients\system.py", line 485, in rename
    shutil.move(from_path, to_path)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 578, in move
    rmtree(src)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 516, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 395, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 404, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "C:\Users\...\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 402, in _rmtree_unsafe
    os.rmdir(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'dbt_packages\\dbt-project-evaluator-0.4.1\\integration_tests'

Operating System

Windows 10

dbt version

1.4.1

dbt Adapter

Snowflake

dbt Power User version

0.11.5

Are you willing to submit PR?

EFox2413 commented 1 year ago

Thanks for posting this!

I had the same error and it was driving me crazy until I disabled dbt power user and it fixed it.

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'dbt_packages\intercom\integration_tests'

I'm on dbt Power User v 0.11.6 and dbt version 1.3.1 BigQuery Windows 11

egor-larin commented 1 year ago

Got the same :(

Frunkh commented 1 year ago

Yeah we got the same issue here. We have to disable the extension in order to execute dbt deps. We have the following packages:

packages:
  - package: dbt-labs/codegen
    version: 0.8.1
  - package: dbt-labs/dbt_utils
    version: 1.0.0
  - package: dbt-labs/dbt_project_evaluator
    version: 0.3.0
  - package: calogica/dbt_expectations
    version: 0.8.2
  - package: elementary-data/elementary
    version: 0.7.3
alexnikitchuk commented 1 year ago

the same issue

tac14yo commented 1 year ago

Same issue here

nguyenann13 commented 1 year ago

Same here

btello commented 1 year ago

Same. The only way that I've found to reliably unblock myself is to Ctrl+Shift+P and then 'reload window'. If you run dbt deps quickly afterwards it usually works.

zachloertscher commented 9 months ago

I'm experiencing the same issue - had to disable dbt power user & reload the window to get dbt deps to work

anandgupta42 commented 9 months ago

@zachloertscher Which version of the extension are using?

Frunkh commented 9 months ago

@zachloertscher Which version of the extension are using?

We're still experiencing the problem with v0.31.3

sweep-ai[bot] commented 6 months ago
Sweeping

0%

Actions

Thank you for reporting this issue with dbt and the Power User extension on Windows. Unfortunately this issue doesn't appear to be caused by a bug in the dbt codebase that Sweep could resolve directly.

The error message points to a file lock issue that is specific to your local Windows environment. To troubleshoot further, I would recommend:

  1. Checking if any other processes have a lock on the dbt_packages directory and killing them if possible.

  2. Trying to reproduce the issue in a clean/new Windows environment and seeing if you can isolate what is causing the lock.

  3. Reporting the issue to the maintainers of dbt and the Power User extension, since this seems to be an interaction between those tools and Windows.

I apologize that Sweep is not able to directly resolve this issue for you. Please let me know if you are able to gather any additional details about reproducing the problem and I can take another look. Thanks for your understanding!

For bonus Sweep issues, please report this bug on our community forum (tracking ID: 99103c1734).


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.