-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
NameError: name conf
is not defined in configuration.py after upgraded to 2.1.0
#16079
Comments
I noticed this issue when using both a secret for sqlalchemy conn, and a custom secrets backend. It existed in Airflow 2.1.0 when using these two (sqlalchemy conn secret, and a custom secrets backend), but not in 2.0.0, and not in 2.1.0 when using a static sqlalchemy conn string. |
@Theis @doowhtron -> would it be possible that you double-check the fix I proposed in: potiuk@19742c1 - it's a simple change in "airflow/configuration.py" - just moving the validation a little later in the config. Would be great to verify that the fix works :) |
Ah. I see you updated the description @doowhtron and you'v come to the same fix I proposed :). Good!. Great minds think alike! |
There was a problem that when we initialized configuration, we've run validate() which - among others - checkd if the connection is an `sqlite` but when the SQLAlchemy connection was not configured via variable but via secret manager, it has fallen back to secret_backend, which should be configured via conf and initialized. The problem is that the "conf" object is not yet created, because the "validate()" method has not finished yet and "initialize_configuration" has not yet returned. This led to snake eating its own tail. This PR defers the validate() method to after secret backends have been initialized. The effect of it is that secret backends might be initialized with configuration that is not valid, but there are no real negative consequences of this. Fixes: apache#16079 Fixes: apache#15685 starting
) There was a problem that when we initialized configuration, we've run validate() which - among others - checkd if the connection is an `sqlite` but when the SQLAlchemy connection was not configured via variable but via secret manager, it has fallen back to secret_backend, which should be configured via conf and initialized. The problem is that the "conf" object is not yet created, because the "validate()" method has not finished yet and "initialize_configuration" has not yet returned. This led to snake eating its own tail. This PR defers the validate() method to after secret backends have been initialized. The effect of it is that secret backends might be initialized with configuration that is not valid, but there are no real negative consequences of this. Fixes: #16079 Fixes: #15685 starting
…che#16088) There was a problem that when we initialized configuration, we've run validate() which - among others - checkd if the connection is an `sqlite` but when the SQLAlchemy connection was not configured via variable but via secret manager, it has fallen back to secret_backend, which should be configured via conf and initialized. The problem is that the "conf" object is not yet created, because the "validate()" method has not finished yet and "initialize_configuration" has not yet returned. This led to snake eating its own tail. This PR defers the validate() method to after secret backends have been initialized. The effect of it is that secret backends might be initialized with configuration that is not valid, but there are no real negative consequences of this. Fixes: apache#16079 Fixes: apache#15685 starting (cherry picked from commit 65519ab)
) There was a problem that when we initialized configuration, we've run validate() which - among others - checkd if the connection is an `sqlite` but when the SQLAlchemy connection was not configured via variable but via secret manager, it has fallen back to secret_backend, which should be configured via conf and initialized. The problem is that the "conf" object is not yet created, because the "validate()" method has not finished yet and "initialize_configuration" has not yet returned. This led to snake eating its own tail. This PR defers the validate() method to after secret backends have been initialized. The effect of it is that secret backends might be initialized with configuration that is not valid, but there are no real negative consequences of this. Fixes: #16079 Fixes: #15685 starting (cherry picked from commit 65519ab)
Apache Airflow version:
Kubernetes version (if you are using kubernetes) (use
kubectl version
):Environment:
uname -a
): 3.10.0What happened:
After upgraded from 2.0.1 to 2.1.0, airflow fails with the error:
I have mask the password in airflow.cfg using the following env vars and define my own secrets backend in airflow.cfg
And I fixed this by moving "conf.validate()":
What you expected to happen:
The upgradation should be compatible.
How to reproduce it:
Use a self-define secret backend
Anything else we need to know:
The text was updated successfully, but these errors were encountered: