2.7.0 db migration job fails with CeleryKubernetesExecutor and Sentry #33651
Labels
area:core
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
Apache Airflow version
2.7.0
What happened
There are actually 2 issues.
Issue 1: Circular import
I installed Airflow on our Kubernetes cluster with CeleryKubernetesExecutor and with Sentry enabled. The database migration job fails due to circular imports. Here is the log:
This can be fixed by changing the import to
from airflow.exceptions import AirflowException
Issue 2: Sentry imports executor with
validate=True
will failsI created a custom docker image with the import fix
from airflow.exceptions import AirflowException
. Then I get another error:This time, there's no reason saying why it cannot import.
I think this is because it's still in the configuration phase, and the SQL engine
airflow/airflow/settings.py
Line 87 in c8a37b6
After some digging, I found this fcbbf47 commit and looks like we should avoid SQL validation during the configuration phase, So, I think this probably can be fixed by adding a
validate=False
to theexecutor_class, _ = ExecutorLoader.import_default_executor_cls()
on https://github.com/apache/airflow/blob/c8a37b6677a6bafa2d6a46874e856de0d6ce04fd/airflow/sentry.py#L90C13-L90C77I have tested this and it works. I will create PR with the fixes mentioned here.
What you think should happen instead
Database migration job should succeed without errors.
How to reproduce
Installed with Airflow Helm chart 1.10.0 and Airflow docker image 2.7.0 python-3.11. Using CeleryKubernetesExecutor, Sentry, and CloudWatch Logs for logging.
The database migration job always fail.
Operating System
Airflow 2.7.0 Python 3.11 docker image
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
Installed with Airflow Helm chart 1.10.0 and Airflow docker image 2.7.0 python-3.11. Using CeleryKubernetesExecutor, Sentry, and CloudWatch Logs for logging.
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: