-
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
Undefined conf
when using AWS secrets manager backend and sql_alchemy_conn_secret
#15685
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
There's a circular reference happening here. The secret backend needs to read configs, but the config wants to read the secret backend during initialisation. Not sure how best to fix this... |
Yeah. We do have a problem with 'conf' causing circular references (not regular circular imports, just references because we have circular dependencies between modules in our code which IMHO should be unentangled and make the dependencies straightforward. It's pretty deeply embedded in the way how configuration is done and the fact that we 'plug-in' the code (like secret backends) to conf which then through chain of dependencies goes back and requires conf (but there are other, similar places with conf being in the middle of circular dependencies). We have some hacks in the code I solved already quite a few of those in the past (for example here: #13260), but it was more of the band-aid rather than final solution. Happy to brainstorm virtually and make some attempt to do it @uranusjr if you would like to (but likely something that we can attempt after 2.1 is released). That might also help in finally getting rid of the last pylint_todo.txt entries - which are there mainly because of the conf becoming the reason for circular dependencies (just to be clear - those are circular dependencies, not imports, those are pretty different problems). |
Recently ran into this issue. Adding an additional FYI that this does not occur in 2.0.1 The error seems to only occur when |
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: 2.2.0
Kubernetes version (if you are using kubernetes) (use
kubectl version
): 1.19 (server), 1.21 (client)Environment:
uname -a
):What happened:
airflow
bin fails during configuration initialization (stack below). I see a similar issue reported here: #13254, but my error is slightly different.What you expected to happen:
airflow
to correctly initialize the configuration.How to reproduce it:
airflow.cfg
Anything else we need to know:
The text was updated successfully, but these errors were encountered: