-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate dbt_utils folder when running dbt deps #4372
Comments
I'm having the exact same problem. Same versions of dbt, dbt_utils, plugins and using Snowflake. Using Windows 10. However, the workaround @abalila used by deleting the Running Running with dbt=0.21.0 |
Update: I ran the cycle of I waited a while and closed VS Code and other apps that might(?) have had some of hook on the files There is some issue going on here and I wish I could give you a solid set of steps to reproduce it. |
Hi folks - thank you for posting this. Question - did this problem crop up in tandem with upgrading to 0.7.4 or had you upgraded and been using successfully before this started to happen? |
@jasnonaz Good question. It happened on the initial install of 0.7.4. I didn't pay much attention to it at the time because I thought I was experiencing a contention issue due to a csv seed file I had open at the same time. Probably bad speculation on my part. After closing that file and re-installing deps, it worked and I assumed that was the issue. It was running fine for a few weeks. Today, I needed to |
Hmmm this is definitely an interesting one!! Can I request that you try to pin your version of utils precisely to Also just to confirm - that is your entire Appreciate you working through this with us here - we're investigating what might be the cause of this internally but want to see if we can isolate it a little better on your end. 🙏 |
@jasnonaz Let me clarify my environment during this experience. I first saw the problem repeatedly when the entirety of my packages.yml file looked like this: packages:
I updated to include the range like this later: packages:
And continued to see the error for at least 3 more Yes, it is weird, but the first occurrences of the problem were when the package was isolated to 0.7.4. |
The I tried pointing to a specific version and I also tried older versions. No matter which version I chose, it resulted in the same error. As @radian21 wrote, it takes multiple tries until the command executed successfully (with deleting the duplicated folder each time). |
Caught it in the act! https://www.loom.com/share/c1a000b2bb6544f4b74a46a05b21724b (45 second mark) It looks like it makes a directory called dbt-utils-0.7.4 and then renames it to dbt_utils a fraction of a second later. The other packages don't behave that way... not sure why! Edit: We went back to utils 0.7.3 as well, and observed the same behaviour, as well as for hubspot_source. I wonder whether it actually does it for all packages, but those ones are larger? 🤷 I feel reasonably confident that this is actually a Core issue, so will shoot it over there! |
Great video, nice work reproducing @joellabes @jasnonaz! I think there are two relevant spots to look at. First up, what's happening when you run dbt-core/core/dbt/deps/registry.py Lines 70 to 74 in d973ae9
Line by line:
Ok! So let's look at dbt-core/core/dbt/clients/system.py Lines 483 to 494 in d973ae9
Step by step:
dbt-core/core/dbt/clients/system.py Lines 469 to 480 in d973ae9
At this point, we need someone with Windows expertise and/or a Windows machine (ideally both!) to help us figure out the right way to handle that rename |
I have neither 😭 |
Just a heads up, I had a user report this happening with the fivetran/jira package as well. |
@sophiad96 was this on dbt Cloud? That would disprove the assumption that it's a Windows-specific issue, right? or was it a cloud user who happened to be on the CLI but reached out to you? |
@joellabes it was on the CLI! I should've mentioned that! |
We're experiencing the same issue on the CLI in Windows with the fivetran/jira package. There are no issues when we run dbt deps in the cloud. |
Same issue here for some Windows users. Edit: After some testing, we were able to get this to work for Windows users by closing VSCode and running the |
I overcame this issue by installing dbt into a new directory. I got a similar error when trying to delete the old directory (Folder In Use - The action can't be completed because the folder or a file in it is open in another program). This prompted me to install docs.microsoft.com/en-us/sysinternals/downloads/… to try to find what was hanging up... I couldn't see anything so I tried deleting the old directory again to see if that helped pinpoint things, but that time I was successful deleting it. Very strange... |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
lol i wish, but keep it open |
I had this problem using dbt-sqlserver 1.3.1 in VS Code on Windows and got it working by pausing my OneDrive sync |
Interesting @andersbergren! Is OneDrive configured to watch/sync/etc your dbt project's directory? |
I'm having this same problem on Windows 10. I setup a new project and tried to start with
I was using python version 3.10.10 and in my debugging I thought it maybe was because of the python version, but I tried different versions in python 3.9 and even 3.8 and it didn't seem to have any difference. Couldn't ever get it to work, but I figured out that by downgrading to I've since upgraded |
Not sure if this is what other people are seeing but I got past this by temporarily disabling the dbt-poweruser extension. It seems like it's related to this issue in the dbt-poweruser extension |
That's interesting. My colleagues and I have been overcoming this issue by closing out of VS Code and running dbt deps in Powershell. It works every time & then we can resume working in VS Code. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
Describe the bug
When running
dbt deps
, it creates another dbt-utils folder which results in an error. The only way to be able to fix dbt from breaking, is to manually delete dbt-utils-x.x.x and not run dbt deps.Running
dbt deps
and the duplicated folder will appear, but after going back and forth with deleting the folder and running the command again, all of a sudden the command would run successfully. Note, I deleted the duplicated folder after each time I got the winerror 32Steps to reproduce
Simply running the command
dbt deps
Expected results
Having
dbt deps
run successfully and receiving a messageUp to date!
as a final outputActual results
When running the command
dbt deps
, a duplicate folder of dbt_utils will be created but with a specific version of the package. In the dbt_modules folder, there will be two dbt_utils folders (dbt_utils folder and dbt-utils-x.x.x folder)Screenshots and log output
System information
The contents of your
packages.yml
file:The content in my
packages.yml
file is as followsWhich database are you using dbt with?
The output of
dbt --version
:Additional context
As mentions above, when deleted the duplicated folder and running
dbt deps
several time, it will eventually execute correctly. In the screenshot below, I run the command everytime and deleted the duplicated folder right after each command until the command executed successfullyAre you interested in contributing the fix?
``
The text was updated successfully, but these errors were encountered: