Skip to content

Conversation

@dstandish
Copy link
Contributor

Candidate to resolve #49476

Migration from 2.10.5 fails.

The issue occurs when the same DAG exists in two different files. In such cases, the condition dag_code.fileloc_hash = serialized_dag.fileloc_hash fails. As a result, the dag_id column in the dag_code table remains null for that specific DAG, leading to the following error:

It is assumed by the migration process that there will not be any dag_code records that don't have a serdag record.
It seems this only happens when there are two files with the same dag id.
@dstandish dstandish force-pushed the fix-upgrade-where-dupe-dag-id branch from 2ef1168 to f5c7664 Compare April 20, 2025 15:58
@dstandish dstandish changed the title Fix upgrade where dupe dag Remove dag_code records with no serdag Apr 20, 2025
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same workaround also manually applied and fixed my upgrade issues. As you propose the same I assume the workaround is the final solution.

@jscheffl jscheffl added this to the Airflow 3.0.1 milestone Apr 21, 2025
@jscheffl
Copy link
Contributor

Propose to make this to 3.0.1

@uranusjr uranusjr force-pushed the fix-upgrade-where-dupe-dag-id branch from bb41646 to ee29672 Compare April 21, 2025 07:25
@dstandish dstandish merged commit 4202418 into apache:main Apr 21, 2025
48 of 49 checks passed
@dstandish dstandish deleted the fix-upgrade-where-dupe-dag-id branch April 21, 2025 18:38
kaxil pushed a commit that referenced this pull request Apr 23, 2025
It is assumed by the migration process that there will not be any dag_code records that don't have a serdag record.
It seems this only happens when there are two files with the same dag id.

---------

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
(cherry picked from commit 4202418)
prabhusneha pushed a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
It is assumed by the migration process that there will not be any dag_code records that don't have a serdag record.
It seems this only happens when there are two files with the same dag id.

---------

Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration fails when same dag id appears in two files

7 participants