TJaniF opened a new issue, #48420:
URL: https://github.com/apache/airflow/issues/48420

   ### Apache Airflow version
   
   3.0.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   current main
   
   ### What happened?
   
   `airflow dags reserialize` returns the following error, despite all dags in 
the environment being valid. This seems not connected to any particular dag in 
the environment / happens every time.
   
   ```
   [2025-03-26T21:07:34.923+0000] {manager.py:120} INFO - DAG bundles loaded: 
dags-folder
   [2025-03-26T21:07:34.926+0000] {dagbag.py:574} INFO - Filling up the DagBag 
from /usr/local/airflow/dags
   [2025-03-26T21:07:35.017+0000] {dag.py:1866} INFO - Sync 11 DAGs
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 10, in <module>
       sys.exit(main())
                ^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/__main__.py", line 
58, in main
       args.func(args)
     File "/usr/local/lib/python3.12/site-packages/airflow/cli/cli_config.py", 
line 49, in command
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/utils/cli.py", line 
111, in wrapper
       return f(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^
     File 
"/usr/local/lib/python3.12/site-packages/airflow/utils/providers_configuration_loader.py",
 line 55, in wrapped_function
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/utils/session.py", 
line 101, in wrapper
       return func(*args, session=session, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/usr/local/lib/python3.12/site-packages/airflow/cli/commands/dag_command.py", 
line 711, in dag_reserialize
       dag_bag.sync_to_db(bundle.name, 
bundle_version=bundle.get_current_version(), session=session)
     File "/usr/local/lib/python3.12/site-packages/airflow/utils/session.py", 
line 98, in wrapper
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/models/dagbag.py", 
line 649, in sync_to_db
       update_dag_parsing_results_in_db(
     File 
"/usr/local/lib/python3.12/site-packages/airflow/dag_processing/collection.py", 
line 326, in update_dag_parsing_results_in_db
       for attempt in run_with_db_retries(logger=log):
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 
443, in __iter__
       do = self.iter(retry_state=retry_state)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 
376, in iter
       result = action(retry_state)
                ^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 
398, in <lambda>
       self._add_action_func(lambda rs: rs.outcome.result())
                                        ^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in 
result
       return self.__get_result()
              ^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in 
__get_result
       raise self._exception
     File 
"/usr/local/lib/python3.12/site-packages/airflow/dag_processing/collection.py", 
line 336, in update_dag_parsing_results_in_db
       DAG.bulk_write_to_db(bundle_name, bundle_version, dags, session=session)
     File "/usr/local/lib/python3.12/site-packages/airflow/utils/session.py", 
line 98, in wrapper
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/models/dag.py", line 
1872, in bulk_write_to_db
       dag_op.update_dags(orm_dags, session=session)
     File 
"/usr/local/lib/python3.12/site-packages/airflow/dag_processing/collection.py", 
line 475, in update_dags
       dm.calculate_dagrun_date_fields(dag, last_automated_data_interval)  # 
type: ignore[arg-type]
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/usr/local/lib/python3.12/site-packages/airflow/models/dag.py", line 
2408, in calculate_dagrun_date_fields
       next_dagrun_info = dag.next_dagrun_info(last_automated_data_interval)
                          ^^^^^^^^^^^^^^^^^^^^
   AttributeError: 'DAG' object has no attribute 'next_dagrun_info'
   ```
   
   ### What you think should happen instead?
   
   The dags should reserialize without error. 
   
   ### How to reproduce
   
   run `airflow dags reserialize` 
   
   ### Operating System
   
   MacOS 15.3.2 (24D81)
   
   ### Versions of Apache Airflow Providers
   
   None
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   Tried inside the container for the last nightly Astro CLI and in breeze 
current-ish main
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to