[stable/airflow] sql_alchemy_conn value incorrect for Airflow CLI commands #22477
Comments
@alexbegg, I have fixed this in an upcoming release |
@alexbegg, this has been fixed in 7.1.0 |
This is still happening in the 7.1.0 and 7.1.5 releases |
Looks like you folks fixed in 7.1.6 |
I get the same error when running - |
Yeah it works when I go straight into the shell and properly interprets the CeleryExecutor is in use, but running an |
The workaround i did is adding to the command - |
This is caused by |
When would this change take place in the official release? |
FYI, you can just use the method documented in the README.md, and run the following to get an interactive bash shell: # use this to run commands like: `airflow create_user`
kubectl exec \
-it \
--namespace airflow \
--container airflow-scheduler \
Deployment/airflow-scheduler \
/bin/bash But I will fix the environment variables at some point. |
@thesuperzapper Yep, I'm able to do that as a workaround. However, it'll be nice in a simple post helm deployment script to run in a remote shell vs. interactive one once you update the environment variable! |
EDIT. chart version: airflow-7.8.0, app version: 1.10.12 But, the
|
I have now fixed this issue in |
Describe the bug
When running Airflow CLI commands such as the
airflow create_user
command it beings up an error sayingcannot use sqlite with the CeleryExecutor
even when I am using the default "postgresql: enabled: true" and default "executor: CeleryExecutor".Version of Helm and Kubernetes:
Helm: 3.2.1
Kubernetes: 1.15.7
Which chart:
stable/airflow version 7.0.1
What happened:
I have "AIRFLOW__WEBSERVER__RBAC: True" which requires me to create a user before I can log in. When accessing the shell of the "airflow-web" container and attempting to create a user via the
airflow create_user
cli command it brings up an errorI have "postgresql" as "enabled: true" so it should be using postgresql not sqlite. This happened with any other cli command such as "airflow list_dags" as well.
After trial and error it seems that explicitly setting
AIRFLOW__CORE__SQL_ALCHEMY_CONN
as part of the "airflow: config" values to the default end-result value ofpostgresql+psycopg2://postgres:airflow@airflow-postgresql:5432/airflow
allows for Airflow CLI commands such asairflow create_user
to work, but this shouldn't be necessary. Airflow CLI commands should work with the default chart values.What you expected to happen:
After running an Airflow CLI command such as "airflow list_dags" it should not error because
AIRFLOW__CORE__SQL_ALCHEMY_CONN
should be set as an actual environment variable of the containerHow to reproduce it (as minimally and precisely as possible):
kubectl exec -t -I AIRFLOW-WEB_POD_NAME -c airflow-web bash
airflow list_dags
Anything else we need to know:
It appears the problem is that
export AIRFLOW__CORE__SQL_ALCHEMY_CONN=
is set as part of the entrypoint "args" intemplates/deployments-web.yaml
. I think a solution would be to have this set as part of the "env" list but I don't know enough about Helm Charts to make the change myself. The same should go forAIRFLOW__CELERY__RESULT_BACKEND
andAIRFLOW__CELERY__BROKER_URL
as well.The text was updated successfully, but these errors were encountered: