-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Bug] dbtCore - after upgrading, can't run DBT #10135
Comments
@moseleyi Could you run Also - you might try installing all of these by name, along with the
|
@jtcohen6 I have the same issue, this is the output you asked for:
The issue persists when I uninstall and then reinstall |
Thanks @rubenhelsloot! Are you also using Python 3.12? |
My output:
Some people in my team got it working but maybe because it was clean install, they never had to use python packages before. Perhaps some dependencies of dbt are not updated with the latest update? |
Surprisingly dbt 1.7.13 works fine with Python 3.12.3 - I checked on my other laptop |
@rubenhelsloot! Are you also using Windows? @moseleyi Which commands are you using to installing dbt? Are you using a virtual environment with The following files and commands worked for me:
Create this file:
Run these commands: python3 -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
source env/bin/activate
python --version
dbt --version
deactivate Output:
|
In case helpful, when I upgraded to dbt-core 1.8, I had the same issue on Python 3.9.6 (OS: Mac Ventura 13.4.1), and it was resolved on upgrade to Python 3.12.3. |
I don't use venv nor poetry. At first I just upgraded All of them produce this error |
Reproduced with Python 3.10.
|
Had the same issue with Python 3.9.18 -> solved when I upgraded to Python 3.11.6 I use poetry and upgraded through
|
I was hoping it was about python issue but seems like it's not. It could be a dependency that should be updated with dbt core update but isn't being forced to update? |
I also found this: AltimateAI/vscode-dbt-power-user#1029 but we all have |
A bit more info: I had the same problem, I can reproduce at will, Python 3.11.8: Install Bump to
Delete venv, same requirements.txt, pip install - get 1.8, works fine. In the broken venv, the factory.py (and other) files in dbt/adapters is missing. You should be able to reproduce these steps exactly with a codespace off https://github.com/brabster/pypi_vulnerabilities |
Thanks for this info @brabster 🏅 Could you share the contents of your |
@dbeatty10 Clean venv, set to dbt-bigquery==1.7.7 to force pre-1.8.0 and install. Works. |
Thank you @brabster ! 🏅 I was able to reproduce the error using your description. See "reprex" below for full details. @jtcohen6 when I tried running
|
When I got the same error as the reported above, the following workaround resolved it for me: python -m pip uninstall -y dbt-adapters
python -m pip install --upgrade dbt-core dbt-common dbt-adapters
dbt --version The The 2nd command can be replaced with whichever command you use to install the requirements for dbt 1.8. |
Yes, this workaround seems to work. But what is the underlying issue? |
Seems to be related to the move of dbt-adapters from part of dbt-core to standalone. I can upgrade no problem from a 1.8 pre-release to latest, but anything from before dbt-adapters being standalone and boom. I can see in verbose pip install logs that it's going around deleting the files in dbt/adapters/... but no evidence that it knows to replace them. Weird. I wonder if it's something to do with going to a standalone dependency but having all the files end up in the same place, maybe a kind of race condition so they are already there when it's checking what to install, but then it goes and deletes them afterwards leaving you broken. Perhaps moving the standalone adapters directory tree away from where it used to be could resolve the problem? Not had chance to check |
@moseleyi I don't know the underlying root cause. But I'm able to see some differences when I create two different virtual environments:
Difference 1One of the differences is in this file:
Difference 2
These are the files/folders that are within both:
|
Here's another command that resolved the error for me: python -m pip install --force-reinstall dbt-adapters |
For info |
Following previous comments - I think it might be a bug in pip? Seems like the last thing pip does is uninstall the old versions including the old dbt-core, which used to contain the adapters directory and doesn't anymore. If it's deleting the common files with the new dbt-adapters package when it does that uninstall, that might explain the missing files when you try to upgrade from core to standalone adapters
|
Same problem here. @dbeatty10 's solution worked for me.
|
I had a look around in the pip source code and if I'm understanding this correctly, it's clear what the problem is and any upgrade from pre-standalone adapters to standalone adapters will break in this way. After interrogating PyPI for the latest versions of things, we get this (verbose) log line like this:
That's from line 54 here which enumerates to_install - an OrderedDict, so the packages are always in alpha order, and Now on line 61, pip loops over the ordered requirements, i.e. Because It's certainly possible I'm wrong, but I attach a verbose upgrade log and you can see the ordering and uninstall activity happening in a manner consistent with this explanation towards the end. It also explains every reported behaviour in this issue:
If I can find an old version of dbt-core that didn't have those adapters files in that specific location, then I think an upgrade should work, if my theory is correct. Will let you know if I can verify that. ===== Update Seems that adapters structure has been there since the first version of dbt-core in PyPI. Instead, I installed dbt-core==1.7.0 into a fresh venv, then hacked the site-packages/dbt-core...dist-info/RECORD file to remove all mention of anything in dbt/adapters. Then I
Not sure how come dbt-adapters ends up in a common directory structure as dbt-core but strikes me as not ideal as it means it's not really independent. Any oversight and chance collision could cause weird problems on update. Setting dbt-adapters to install where I'd have expected it in its own director under site packages should solve the problem and avoid any regression? |
This worked for me. Thanks @dbeatty10 . |
I found a way to upgrade to 1.8 with poetry by downgrading dbt-adapters to 1.1.0 and then updating it to 1.1.1 but it's not ideal. Details
$ poetry add --group dev dbt-core=^1.8.1 dbt-snowflake=^1.8.2
$ poetry add --group dev dbt-adapters = "^1.1.0" change the following in pyproject.toml
$ poetry lock --no-update $ dbt version
$ dbt debug
change the following in pyproject.toml
$ poetry lock --no-update $ dbt version
$ dbt debug
|
+1 worked for me as well. I am on mac, ran the following: Encountered the error with adapters. ran the |
Upgraded python version from 3.11.5 to 3.12.3, and it worked. |
This work for me |
For those using poetry env remove 3.12
poetry install |
Ran into this too using a venv on python 3.12.0
Got this message while doing so, but everything works, so not sure if relevant
|
Is this a new bug in dbt-core?
Current Behavior
I installed dbt-core, bigquery, and postgres, and then when typing
dbt --version
I get this error:This is after installing bigquery, postgres,
Expected Behavior
Should show the version of dbt packages
Steps To Reproduce
dbt --version
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: