Replies: 2 comments 2 replies
-
I think you might be encountering the same issue as I did, but I've identified the root cause. It turns out that incorrect indexes on the dataset table can lead to this query error. You can check the indexes on the dataset table by running the command I suspect that during the data migration, only the data was restored, and the table indexes were not correctly migrated, which led to this issue. FYI @q121212 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yep converting to a discussion. My few recommendations:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.9.1 and 2.9.2
What happened?
After migrating the PostgreSQL database to another server, we encountered an issue where the Airflow scheduler crashes with the following error:
Upon reviewing the call stack, it seems the crash occurs during the
_orphan_unreferenced_datasets
method. Here is its code:It appears that the
dataset
,dag_schedule_dataset_reference
, andtask_outlet_dataset_reference
tables are empty.From my understanding, selecting all columns of a model without proper grouping might be incorrect.
My solution:
Correct, as far as I know the SQL syntax will only select
DatasetModel.id
I really have a question - how did it work before the pg db migration? - the airflow code did not change (Maybe this function was simply not called for some reason before the database migration?). But in fact it looks like a bug.
What you think should happen instead?
The query in _orphan_unreferenced_datasets should handle cases where tables may be empty or ensure correct SQL grouping to avoid errors.
How to reproduce
Operating System
Versions of Apache Airflow Providers
Deployment
Other
Deployment details
deployed as linux service
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions