dbt deps issue in new initialized vscode env

Initialized dbt in vscode for the first time after testing my bigquery adapter connection. But when I run dbt deps or dbt --no-version-check deps code, I get the following error

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: ‘dbt_packages\dbt_metrics-1.3.2\integration_tests’

Unable to delete the packages folders as suggested by chatgpt. Tried dbt clean command as well. Nothing works.

Try manually deleting the dbt_packages folder, quitting VSCode, and then open a separate command line application like GitBash (anything but VSCode), navigate to the root of your dbt project, and run dbt deps. Then re-open the dbt project in VSCode.

2 Likes

Thank you. I tried with Process Explorer and that sorted the issue. But getting a different error now.

Encountered an error:
Parsing Error
Invalid metrics config given in FilePath(searched_path=‘models’, relative_path=‘1-staging\ads\metrics.yml’, modification_time=1720463882.679679, project_root=‘rootfolder’) @ metrics: {‘name’: ‘total_paid_spend’, ‘label’: ‘Total Paid Spend’, ‘model’: “ref(‘prod_ads_timeline’)”, ‘description’: ‘Total paid ad spend’, ‘expression’: ‘spend’, ‘calculation_method’: ‘sum’, ‘timestamp’: ‘report_date’, ‘time_grains’: [‘week’, ‘month’, ‘quarter’, ‘year’], ‘dimensions’: [‘platform’]} - at path : Additional properties are not allowed (‘calculation_method’, ‘dimensions’, ‘expression’, ‘model’, ‘time_grains’, ‘timestamp’ were unexpected)

I havent changed anything

Hello,
Thanks for asking this, i am also facing the same problem.

I have finally tracked down the source of this issue.

The “Power User for dbt” is creating an endless loop of processing dbt deps for packages containing integration_tests, due to the presence of packages.yml in integration_tests referencing “local: …/”.

This causes the process to endlessly loop, until it finally fails.

I am getting the same issue, how you solved it? We should just disable the extension?

The only way I have been able to work around the issue is to run “dbt clean” twice to cause the dbt_packages folder to be deleted.

Then the same issue comes back.