apache / apache/airflow

DAG import error after v3 upgrade

Open
#56,306 1 comment 1 reaction 0 assignees View on GitHub
area:db-migrations area:MetaDB kind:bug
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 10h
Merged PRs (30d)
483

Description

Hi community,

I run into the same error after Airflow was upgraded to version 3, and worked around it by updating the `dag_id` parameter with a different value. I did delete all entries in `serialized_dag` table but not `dag_code` table. I guess both ways may trigger the same logic in the codes to work around the error. Just to see if someone happens to know the cause.

> Is there a way to fix this manually?
>
> airflow db migrate was failing (no dag_id in the dag_code table). I ended up deleting rows in the dag_code and serialized_dag tables but now my DAG processor has these errors:
>
> ```
> latest_ser_dag._data = new_serialized_dag._data
> ^^^^^^^^^^^^^^^^^^^^
> AttributeError: 'NoneType' object has no attribute '_data'
> ```
>
> I tried entering the dag processor pod and running `airflow dags reserialize` but no luck.

If you have access to DB, truncate `dag_code` and `serialized_dag` table.

_Originally posted by @kaxil in https://github.com/apache/airflow/issues/49563#issuecomment-2857985521_

Contributor guide

Open the contributing guide

Research direction

Start with the DAG processor traceback and the reported `airflow db migrate` failure, then inspect how the `dag_code` and `serialized_dag` tables are handled after the version 3 upgrade. Reproduce the import error with the described table state; done means the cause and a reliable manual or code-level fix are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.