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

   ### Apache Airflow version
   
   2.8.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I am using a very simple dag which has schedule set has @hourly. Scheduler 
is not scheduling it and giving error in logs.
   ```
   import datetime
   from airflow import DAG
   from airflow.operators.empty import EmptyOperator
   
   my_dag = DAG(
       dag_id="my_dag_name",
       start_date=datetime.datetime(2021, 1, 1),
       schedule="@hourly",
   )
   EmptyOperator(task_id="task", dag=my_dag)
   ```
   Error in log:
   ```
   ERROR [airflow.models.dag.DAG] Failed to fetch run info after data interval 
DataInterval(start=DateTime(2024, 3, 2, 0, 0, 0, tzinfo=Timezone('UTC')), 
end=DateTime(2024, 3, 2, 1, 0, 0, tzinfo=Timezone('UTC'))) for DAG 'my_dag_name'
   Traceback (most recent call last):
     File "/usr/local/lib/python3.11/site-packages/airflow/models/dag.py", line 
1032, in next_dagrun_info
       info = self.timetable.next_dagrun_info(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/usr/local/lib/python3.11/site-packages/airflow/timetables/interval.py", line 
90, in next_dagrun_info
       earliest = self._skip_to_latest(earliest)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/usr/local/lib/python3.11/site-packages/airflow/timetables/interval.py", line 
157, in _skip_to_latest
       raise AssertionError("next schedule shouldn't be earlier")
   ```
   
   If I set catchup_by_default to True or change the schedule to more than an 
hour it works fine.
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   NA
   
   ### Operating System
   
   Debian GNU/Linux 11 (bullseye)
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   Using a custom docker image. Airflow configuration:
   
   * Executor: Celery
   * Database: Postgresql 14
   * Docker base image: python:3.11-bullseye
   
   ### 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