-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Adding UIAlert in local settings fails with Sentry enabled #31442
Comments
comment: Seems that indeed we have a circular import happening when UIAlert is created in local_settins. |
Very interesting bug :) . The root cause is AIP-51 related change #28375 which added executor initialization in Sentry's ConfiguredSentry()
It's an interesting sequence of events:
@o-nikolas @rkarish you might want to take a look and do some other way of checking if the executor we have supports sentry - without necessarily initializing it. This might be tricky. |
BTW. Initializing UI Alert view in local settings is perfectly fine and recommended by us in case anyone asked. |
cc: @gil-tober who created the original issue. As discussed in #31408 (reply in thread) - maybe a good solution could be utilizing listeners |
This is mentioned in #31408 I will try the workaround you suggested and will post my findings. For now, I found that setting airflow/airflow/executors/executor_loader.py Lines 160 to 186 in 9137740
Our metadb is Postgres, so the check for |
I faced a similar issue today with Airflow 2.8.4 (Db migration worked successfully but later, the scheduler and webserver can not start and keep crashing due to the error below) Our environment:
Error log from the scheduler
Setting |
The import might be invoked when K8S executor starts with sentry on and it might lead to circular imports Related: apache#31442
This is a different issue and likely to be addressed by #39062 - which should be available in the next cncf.kubernetes after merging. |
The import might be invoked when K8S executor starts with sentry on and it might lead to circular imports Related: #31442
The import might be invoked when K8S executor starts with sentry on and it might lead to circular imports Related: apache#31442
…sion (#39056) * Fixes #36629 * Fixes PR failed test * Remove an parametrize duplicate tests * Fix formatting * Fix formatting * Fixes #36629 * Fixes PR failed test * Remove an parametrize duplicate tests * update simple-salesforce type hints to support 1.12.6 (#39047) * Fix formatting * Add changelog for airflow python client 2.9.0 (#39060) * Upgrade to latest hatchling as build dependency (#39044) * Prepare docs 1st wave (RC3) + ad hoc April 2024 (#38995) (#39054) * Prepare docs 1st wave (RC3) + ad hoc April 2024 (#38995) * update databricks * [docs] update `DagBag` class docstring to include all params (#38814) * update docstring for DagBag class * break long line * fix space Signed-off-by: kalyanr <[email protected]> --------- Signed-off-by: kalyanr <[email protected]> * Data aware scheduling docs edits (#38687) * Moves airflow import in deprecated pod_generator to local (#39062) The import might be invoked when K8S executor starts with sentry on and it might lead to circular imports Related: #31442 * KPO xcom sidecar PodDefault usage (#38951) We should use the same, non deprecated, version of PodDefaults for the xcom sidecar when creating and reading xcom. * Fix formatting * Change date/time parsing method for newer_than parameter un SFTPSensor * Add examples in AWS auth manager documentation (#39040) * update document (#39068) * Update hatchling to version 1.24.0 (#39072) * Check that the dataset<>task exists before trying to render graph (#39069) * Change date/time parsing method for newer_than parameter un SFTPSensor * Fix utc timezone in unit tests * Fix utc timezone in unit tests --------- Signed-off-by: kalyanr <[email protected]> Co-authored-by: Grégoire Rolland <[email protected]> Co-authored-by: Hussein Awala <[email protected]> Co-authored-by: Ephraim Anierobi <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Kalyan <[email protected]> Co-authored-by: Laura Zdanski <[email protected]> Co-authored-by: Jed Cunningham <[email protected]> Co-authored-by: Vincent <[email protected]> Co-authored-by: humit <[email protected]> Co-authored-by: Brent Bovenzi <[email protected]>
…sion (apache#39056) * Fixes apache#36629 * Fixes PR failed test * Remove an parametrize duplicate tests * Fix formatting * Fix formatting * Fixes apache#36629 * Fixes PR failed test * Remove an parametrize duplicate tests * update simple-salesforce type hints to support 1.12.6 (apache#39047) * Fix formatting * Add changelog for airflow python client 2.9.0 (apache#39060) * Upgrade to latest hatchling as build dependency (apache#39044) * Prepare docs 1st wave (RC3) + ad hoc April 2024 (apache#38995) (apache#39054) * Prepare docs 1st wave (RC3) + ad hoc April 2024 (apache#38995) * update databricks * [docs] update `DagBag` class docstring to include all params (apache#38814) * update docstring for DagBag class * break long line * fix space Signed-off-by: kalyanr <[email protected]> --------- Signed-off-by: kalyanr <[email protected]> * Data aware scheduling docs edits (apache#38687) * Moves airflow import in deprecated pod_generator to local (apache#39062) The import might be invoked when K8S executor starts with sentry on and it might lead to circular imports Related: apache#31442 * KPO xcom sidecar PodDefault usage (apache#38951) We should use the same, non deprecated, version of PodDefaults for the xcom sidecar when creating and reading xcom. * Fix formatting * Change date/time parsing method for newer_than parameter un SFTPSensor * Add examples in AWS auth manager documentation (apache#39040) * update document (apache#39068) * Update hatchling to version 1.24.0 (apache#39072) * Check that the dataset<>task exists before trying to render graph (apache#39069) * Change date/time parsing method for newer_than parameter un SFTPSensor * Fix utc timezone in unit tests * Fix utc timezone in unit tests --------- Signed-off-by: kalyanr <[email protected]> Co-authored-by: Grégoire Rolland <[email protected]> Co-authored-by: Hussein Awala <[email protected]> Co-authored-by: Ephraim Anierobi <[email protected]> Co-authored-by: Jarek Potiuk <[email protected]> Co-authored-by: Elad Kalif <[email protected]> Co-authored-by: Kalyan <[email protected]> Co-authored-by: Laura Zdanski <[email protected]> Co-authored-by: Jed Cunningham <[email protected]> Co-authored-by: Vincent <[email protected]> Co-authored-by: humit <[email protected]> Co-authored-by: Brent Bovenzi <[email protected]>
Discussed in #31408
Originally posted by gil-tober May 18, 2023
Apache Airflow version
2.6.1
What happened
When upgrading Airflow from 2.5.3 to 2.6.1 the
airflow-run-migration
job fails.I have deployed the same setup to our DEV environment (where Sentry is disabled) and the upgrade succeeded without an issue.
After that I tried deploying to our PROD environment where Sentry is enabled and the job failed with the error below.
I tried enabling Sentry on DEV and the upgrade failed.
Took a look at
airflow.executors.executor_loader.py
at lines 162-185 when the exception is raised from. Setting the environment variable_AIRFLOW__SKIP_DATABASE_EXECUTOR_COMPATIBILITY_CHECK=1
fixed the error getting in the upgrade job. (Our metadb is Postgres)What you think should happen instead
migrateDatabaseJob should not fail when Sentry is enabled
How to reproduce
Upgrade from 2.5.3 to 2.6.1 with CeleryKubernetesExecutor and Sentry enabled
Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==8.0.0
apache-airflow-providers-celery==3.1.0
apache-airflow-providers-cncf-kubernetes==6.1.0
apache-airflow-providers-common-sql==1.4.0
apache-airflow-providers-docker==3.6.0
apache-airflow-providers-elasticsearch==4.4.0
apache-airflow-providers-ftp==3.3.1
apache-airflow-providers-google==8.3.0
apache-airflow-providers-grpc==3.1.0
apache-airflow-providers-hashicorp==3.3.1
apache-airflow-providers-http==4.3.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-jenkins==3.2.1
apache-airflow-providers-microsoft-azure==6.0.0
apache-airflow-providers-mysql==5.0.0
apache-airflow-providers-odbc==3.2.1
apache-airflow-providers-postgres==5.3.1
apache-airflow-providers-redis==3.1.0
apache-airflow-providers-salesforce==5.3.0
apache-airflow-providers-sendgrid==3.1.0
apache-airflow-providers-sftp==4.2.4
apache-airflow-providers-slack==7.2.0
apache-airflow-providers-snowflake==4.0.5
apache-airflow-providers-sqlite==3.3.2
apache-airflow-providers-ssh==3.6.0
apache-airflow-providers-tableau==4.1.0
Deployment
Official Apache Airflow Helm Chart
Deployment details
Airflow deployed on an EKS cluster using the official Airflow Helm Chart (V1.9.0)
MetaBD is a Postgres RDS
CeleryKubernetesExecutor
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: