-
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] "RecursionError: maximum recursion depth exceeded" in Python3.10 #4560
Comments
Hey @s2terminal, dbt does not support Python 3.10 (yet!) and as such the recommended action is what you have already done, downgrade to 3.9 until 3.10 is officially supported. Looking at the error message it appears this is not caused by dbt but by the |
@pgoslatara Thanks for the answer, I will downgrade the python version to 3.9. |
I don't think this bug is completed, as I presume dbt-core will at some point support python 3.10 and this is a problem still. logbook hasn't received updates since 2019 so it might be worth migrating off it ASAP. |
Hey @haf -
|
@jtcohen6 Thanks for clarifying that. While I have you on the line, what's the process for adjusting the logging level for dbt-core in 1.1+ when using dbt as a python module? |
@jtcohen6 And also; I tried upgrading to dbt-core v1.2 and the deprecation this thread is about is spammed relentlessly in the output. How does the support relate to fixing this issue? (because it's an issue despite upgrading) |
this is rather bizarre, but I am installing dbt-bigquery@1.0.0 and the first thing it installs is python 3.10?!?! Isn't that rather a problem?
I had thought the install was just looking for the latest version of python3, so just prior to this install, I had uninstalled python 3.10 explicitly and installed 3.9. I am using a model that was developed under dbt 1.0.0, so I'm a bit loathe to use dbt 1.1 against that model. Any pointers? |
@koconnor-ampion I have the same thing for dbt-snowflake@1.0.0 - it installs python 3.10 . Recursion error made my day =) I had to uninstall dbt-snowflake 1.0.0, then installed python 3.9, then found a new version of dbt-snowflake - 1.3.0 and it didn't cause the problem (I tried to install snowflake1.0.0 after python 3.9 installation, but it still was trying to install python 3.10, so I interrupted it). I hope there is a new package for bigquery as well. Not sure whether new dbt-snowflake package picked my python 3.9 or perhaps you can try skip this part. |
So what's the status of this? Can I opt into the new logging methods? According to the docs 3.10 is now supported https://docs.getdbt.com/faqs/core/install-python-compatibility |
@haf You shouldn't need to opt in to the new logging behavior in dbt, but one thing to check is whether you have the DBT_ENABLE_LEGACY_LOGGER environment variable set. If so, you'll want to get rid of it. Assuming that is not the problem, could you share more details about the steps you're taking to generate the error message you're getting? Most people using dbt 1.4 with Python 3.10 are not encountering this issue, so it will be helpful to have as much information about your scenario as possible. |
@peterallenwebb Here's a repro. A regex from Jinja was being fed into the old logging infrastructure and got interpreted. Seems like you might have yourself a log4j here https://logging.apache.org/log4j/2.x/security.html — but I'm not feeling up for finding an expansion that executes; infinite recursion is enough for a DoS. ;) Of course since it requires you to use dbt as a package, this has a pretty small blast radius. |
Thank you for the repro project, @haf. Unfortunately, even after I spent an hour trying to reproduce your issue with various dbt versions and configuration, I haven't had luck. The runs just succeed for me:
If you'd like to continue investigating, can you provide the following?
|
@dbeatty10 it should all be in the repro, but here's a screen recording of following the readme in case it's a mac-specific issue Also thank you for investigating!🙏 |
@peterallenwebb ping, any progress the last two weeks? From your pasted output, it doesn't seem like you're running with poetry like the repro is? |
@haf Yes. You're right. I was able to reproduce the issue using your video. Thanks for that. Using dbt as a library in this way isn't technically a supported use case for dbt yet, though we are making steps in that direction for 1.5 and future versions. Even so, I'll set aside some time on Monday to see if I can suggest a solution for you. |
Update dbt-bigquery to avoid the Python recursion error with Python 3.10 Context: http://go/gh/dbt-labs/dbt-core/issues/4560
I hit this issue as well. I tried to create a new macro vertica__create_constraints, copying from the Postgres version, and updating SQL queries for Vertica. Hard to say where I made a mistake, very hard to debug this. Using: Will try to derive the new Vertica macro from Snowflake, it looks more mature, maybe I will succeed. |
The new logbook maintainer has now reached this bug in the process of clearing the long backlog. getlogbook/logbook#333 The additionally confusing part is that dbt-core says in a code comment that Lines 55 to 58 in 7fbfd53
Line 5 in 7fbfd53
|
Correct - we've kept the "legacy logger" around to keep supporting some older integrations, but we disable it unless a specific env var is switched on: Lines 454 to 455 in 7fbfd53
We're planning to remove it (finally) in dbt-core v1.7 (October): |
it seems to be that logbook still exists in the latest version of dbt. Currently we have issue with logbook when using auditwheel to build dbt. So can you just remove it from dbt-core or upgrade it to the new version?
|
Is there an existing issue for this?
Current Behavior
When I run
dbt run
ordbt docs generate
in Python 3.10, the standard output continues indefinitely. I think the program is in an infinite loop.The following is an excerpt of some of the output.
Expected Behavior
dbt run
is succeed.By using the Python 3.9.9, I was able to confirm that the same configuration would be successful.
Steps To Reproduce
Environment: Python 3.10.1-slim in docker
install and initialize dbt
run
Relevant log output
no log # wc logs/dbt.log 0 0 0 logs/dbt.log
Environment
What database are you using dbt with?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: