-
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
[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. |
@Evelyn-yx-Li We're not aware of anything we can do about this that wouldn't risk breaking other things. So if you're getting this error in your GitHub Actions, then we'd recommend adding a workaround to handle it. |
@Evelyn-yx-Li it seems that this is explicitly an upgrading problem, so possibly it's related to caching dependency installs e.g. if you're doing so via That said, we're caching |
@elyobo confident this is the underlying reason #10135 (comment). If so it is explicitly an upgrading problem, because of the order in which packages are cleaned up and dbt's placing multiple modules into a shared directory structure. Explains the variety of issues reported. |
Hi, I've tried the solutions above in our prod, but it shows "command not found". Both force-reinstall and uninstall dbt-adapters. But it works well within local and CI. ------------------------------------------------------------------------------------------------------------------------
DBT VERSION
------------------------------------------------------------------------------------------------------------------------
Checking DBT version...
dbt -v
./dbt-forklift.sh: line 49: dbt: command not found
------------------------------------------------------------------------------------------------------------------------
SET UP DBT
------------------------------------------------------------------------------------------------------------------------
Installing DBT dependencies...
pip uninstall -y dbt-adapters
WARNING: Skipping dbt-adapters as it is not installed.
pyenv: cannot rehash: /usr/local/.pyenv/shims isn't writable
pip install dbt-core dbt-bigquery==1.8.1 dbt-redshift==1.8.0 dbt-snowflake==1.8.3
Defaulting to user installation because normal site-packages is not writeable
Collecting dbt-core
Using cached dbt_core-1.8.2-py3-none-any.whl.metadata (3.9 kB)
Collecting dbt-bigquery==1.8.1
Using cached dbt_bigquery-1.8.1-py3-none-any.whl.metadata (3.2 kB)
Collecting dbt-redshift==1.8.0
Using cached dbt_redshift-1.8.0-py3-none-any.whl.metadata (3.2 kB)
Collecting dbt-snowflake==1.8.3
Using cached dbt_snowflake-1.8.3-py3-none-any.whl.metadata (3.2 kB)
Collecting dbt-common<2.0,>=1.0.4 (from dbt-bigquery==1.8.1)
Using cached dbt_common-1.3.0-py3-none-any.whl.metadata (5.3 kB)
Collecting dbt-adapters<2.0,>=1.1.1 (from dbt-bigquery==1.8.1)
Using cached dbt_adapters-1.2.1-py3-none-any.whl.metadata (2.5 kB)
Collecting google-cloud-bigquery<4.0,>=3.0 (from google-cloud-bigquery[pandas]<4.0,>=3.0->dbt-bigquery==1.8.1)
Using cached google_cloud_bigquery-3.24.0-py2.py3-none-any.whl.metadata (8.9 kB)
Collecting google-cloud-storage~=2.4 (from dbt-bigquery==1.8.1)
Using cached google_cloud_storage-2.17.0-py2.py3-none-any.whl.metadata (6.6 kB)
Collecting google-cloud-dataproc~=5.0 (from dbt-bigquery==1.8.1)
Using cached google_cloud_dataproc-5.9.3-py2.py3-none-any.whl.metadata (5.2 kB)
Collecting google-api-core>=2.11.0 (from dbt-bigquery==1.8.1)
Using cached google_api_core-2.19.0-py3-none-any.whl.metadata (2.7 kB)
Collecting dbt-postgres~=1.8.0 (from dbt-redshift==1.8.0)
Using cached dbt_postgres-1.8.1-py3-none-any.whl.metadata (3.4 kB)
Collecting redshift-connector!=2.0.914,<2.0.918,>=2.0.913 (from dbt-redshift==1.8.0)
Using cached redshift_connector-2.0.917-py3-none-any.whl.metadata (66 kB)
Collecting sqlparse<0.6.0,>=0.5.0 (from dbt-redshift==1.8.0)
Using cached sqlparse-0.5.0-py3-none-any.whl.metadata (3.9 kB)
Collecting agate (from dbt-redshift==1.8.0)
Using cached agate-1.11.0-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting snowflake-connector-python~=3.0 (from snowflake-connector-python[secure-local-storage]~=3.0->dbt-snowflake==1.8.3)
Using cached snowflake_connector_python-3.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
Collecting agate (from dbt-redshift==1.8.0)
Using cached agate-1.9.1-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting Jinja2<4,>=3.1.3 (from dbt-core)
Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting mashumaro<4.0,>=3.9 (from mashumaro[msgpack]<4.0,>=3.9->dbt-core)
Using cached mashumaro-3.13-py3-none-any.whl.metadata (114 kB)
Collecting logbook<1.6,>=1.5 (from dbt-core)
Using cached Logbook-1.5.3.tar.gz (85 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting click<9.0,>=8.0.2 (from dbt-core)
Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting networkx<4.0,>=2.3 (from dbt-core)
Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Collecting protobuf<5,>=4.0.0 (from dbt-core)
Using cached protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)
Collecting requests<3.0.0 (from dbt-core)
Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting pathspec<0.13,>=0.9 (from dbt-core)
Using cached pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
Collecting dbt-extractor<=0.6,>=0.5.0 (from dbt-core)
Using cached dbt_extractor-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)
Collecting minimal-snowplow-tracker<0.1,>=0.0.2 (from dbt-core)
Using cached minimal-snowplow-tracker-0.0.2.tar.gz (12 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting dbt-semantic-interfaces<0.6,>=0.5.1 (from dbt-core)
Using cached dbt_semantic_interfaces-0.5.1-py3-none-any.whl.metadata (2.6 kB)
Collecting packaging>20.9 (from dbt-core)
Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting pytz>=2015.7 (from dbt-core)
Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting pyyaml>=6.0 (from dbt-core)
Using cached PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting daff>=1.3.46 (from dbt-core)
Using cached daff-1.3.46.tar.gz (149 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting typing-extensions>=4.4 (from dbt-core)
Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting Babel>=2.0 (from agate->dbt-redshift==1.8.0)
Using cached Babel-2.15.0-py3-none-any.whl.metadata (1.5 kB)
Collecting isodate>=0.5.4 (from agate->dbt-redshift==1.8.0)
Using cached isodate-0.6.1-py2.py3-none-any.whl.metadata (9.6 kB)
Collecting leather>=0.3.2 (from agate->dbt-redshift==1.8.0)
Using cached leather-0.4.0-py2.py3-none-any.whl.metadata (2.8 kB)
Collecting parsedatetime!=2.5,>=2.1 (from agate->dbt-redshift==1.8.0)
Using cached parsedatetime-2.6-py3-none-any.whl.metadata (4.7 kB)
Collecting python-slugify>=1.2.1 (from agate->dbt-redshift==1.8.0)
Using cached python_slugify-8.0.4-py2.py3-none-any.whl.metadata (8.5 kB)
Collecting pytimeparse>=1.1.5 (from agate->dbt-redshift==1.8.0)
Using cached pytimeparse-1.1.8-py2.py3-none-any.whl.metadata (3.4 kB)
Collecting colorama<0.5,>=0.3.9 (from dbt-common<2.0,>=1.0.4->dbt-bigquery==1.8.1)
Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting jsonschema<5.0,>=4.0 (from dbt-common<2.0,>=1.0.4->dbt-bigquery==1.8.1)
Using cached jsonschema-4.22.0-py3-none-any.whl.metadata (8.2 kB)
Collecting python-dateutil<3.0,>=2.0 (from dbt-common<2.0,>=1.0.4->dbt-bigquery==1.8.1)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting psycopg2<3.0,>=2.9 (from dbt-postgres~=1.8.0->dbt-redshift==1.8.0)
Using cached psycopg2-2.9.9.tar.gz (384 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
� Getting requirements to build wheel did not run successfully.
� exit code: 1
��> [21 lines of output]
running egg_info
writing psycopg2.egg-info/PKG-INFO
writing dependency_links to psycopg2.egg-info/dependency_links.txt
writing top-level names to psycopg2.egg-info/top_level.txt
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
� Getting requirements to build wheel did not run successfully.
� exit code: 1
��> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
dbt -v
./dbt-forklift.sh: line 61: dbt: command not found
./dbt-forklift.sh: line 62: dbt: command not found
|
@dbeatty10 Do you know if this only relevant for upgrading to 1.8? Or is this going to affect future versions, too? Context: I wonder if I should add the workaround as general recommendation for upgrading dbt |
I also have this issue on upgrade. python --version dbt --version pip freeze | grep 'dbt' pip install --force-reinstall dbt-adapters ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. my req file my test req file but dbt works (But wrong version) dbt --version
Plugins: was concerned that dbt had moved from 1.7.17 to 1.8.3 when it was pinned, changed my dbt tests file dbt-tests-adapter==1.7.17 pip freeze | grep 'dbt' dbt --version
Your version of dbt-core is out of date! Plugins:
At least one plugin is out of date or incompatible with dbt-core. |
@davidwitk I'm assuming this will apply anytime upgrading dbt <1.8.0 to dbt >= 1.8.0. |
@ann8ty I'd recommend trying the commands in #10135 (comment). |
Can you run 1.7.x adapter implementations with dbt 1.8.x core/adapters? If not then that might explain @ann8ty problem, looks like they have pinned exact 1.7.17 Pg/Redshift adapter versions. More general question maybe aimed at @dbeatty10 - If you folks are decoupling versions of adapter implementations from core and adapters packages, how can a user tell whether different versions are compatible? Probably some docs somewhere I haven't found? |
pip install --upgrade dbt-adapters run this command, hopefully it will solve the issue |
|
Simply upgrading |
Re-installing |
After trying all above solutions, Only upgrading python to v3.12 worked for me. 🤷
|
After upgrading to dbt 1.8.4, I also got the error:
I was able to correct this by removing the current adapters and installing it again:
All looks fine now. I am using python
Thanks for helping us resolve this. |
I have some observations to throw in. It appears that the problem is intermittent. I've had the same CI run fail, and then after retrying it had passed. I used a On the same GitHub Actions run, I had three workflows that used dbt install identical steps. One out of three runs had failed with the Then, I clicked "Re-run failed," and it passed.
|
@moltar are you caching the dependencies in the GH Action? I would suspect that for causing intermittent problems as the state of what's ending up on in the filesystem (and then being cached) may be quite unpredictable. I've seen no issues in my GH actions, but I don't cache. If you are caching, maybe try disabling that to get a clean install from scratch? |
@brabster Yup: - name: Install Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.12' |
@brabster Removed caching, but still get random failures. |
@moltar strange - if the root cause I identified earlier is true, clean install should not have a problem (unless something else is going on as well to confound the problem). Curious, so happy to take a look if you can share the details of the workflow between the setup python task the step that fails like what's the specific install command, and any logs you can share about the install/update process? |
Same issue after upgrading dbt within our Airflow stack. We have Python
|
Had this issue with my dbt with oracle adapter. The following code fixed it: |
* fix: add dbt-postgres explictly to dbt-deps group * ci: ignore build cache during pre-releases * fix: temporary disable test to allow merging * ci: update paths in dbt release task * chore: remove dbt-core and dbt-adapters and let dbt-postgres handle dependencies * chore: add dbt-adapters to deps explicitly * chore: update dbt-core manually required by dbt 1.8 see dbt-labs/dbt-core#10135 * ref: add some extra commands to makefile * chore: update dbt deps * chore: remove dbt-osmosis, upgrade deps once more * ref: set elementary tests as warnings * chore: run pre-commit on failing task * chore: remove references to non-existing dirs in dbt_project.yml they were polluting the logs with warning * chore: move existing tests to data_tests directory * chore: update python and pre-commit dependencies * chore: rename tests to data_tests in dbt 1.8 The `tests` config has been renamed to `data_tests`. Please see https://docs.getdbt.com/docs/build/data-tests#new-data_tests-syntax for more * ref: move dbt settings from profiles to dbt_project as per warnings in versions 1.8.1
In my case, after many trials and errors, I discovered that if you reinstall |
closes: #1344 This PR is doing below modification - Upgrade Python version to Python3.12 - Add `--force-reinstall` flag in pip install command - Install dbt-command separately based on suggestion: dbt-labs/dbt-core#10135 (comment) Success CI job: https://github.com/astronomer/astronomer-cosmos/actions/runs/12165978965/job/33931200107?pr=1364
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: