abezruchenkov opened a new issue #18082:
URL: https://github.com/apache/airflow/issues/18082


   ### Apache Airflow version
   
   2.1.3 (latest released)
   
   ### Operating System
   
   ubuntu, macos
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==1.4.0
   apache-airflow-providers-ftp==1.1.0
   apache-airflow-providers-http==1.1.1
   apache-airflow-providers-imap==1.0.1
   apache-airflow-providers-postgres==1.0.2
   apache-airflow-providers-slack==4.0.0
   apache-airflow-providers-sqlite==1.0.2
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   We are using TriggerDagRunOperator in the end of DAG to retrigger current 
DAG:
   
   `TriggerDagRunOperator(task_id=‘trigger_task’, trigger_dag_id=‘current_dag’)`
   
   Everything works fine, except we have missing duration in UI and ​warnings 
in scheduler :
   
   `[2021-09-07 15:33:12,890] {dagrun.py:604} WARNING - Failed to record 
duration of <DagRun current_dag @ 2021-09-07 12:32:17.035471+00:00: 
manual__2021-09-07T12:32:16.956461+00:00, externally triggered: True>: 
start_date is not set.`
   
   And in web UI we can't see duration in TreeView and DAG has no started and 
duration values. 
   
   
   ### What you expected to happen
   
   Correct behaviour with start date and duration metrics in web UI.
   
   ### How to reproduce
   
   ```
   import pendulum
   import pytz
   from airflow import DAG
   from airflow.operators.dummy import DummyOperator
   from airflow.operators.trigger_dagrun import TriggerDagRunOperator
   
   
   with DAG(
           start_date=pendulum.datetime(year=2021, month=7, 
day=1).astimezone(pytz.utc),
           schedule_interval='@daily',
           default_args={},
           max_active_runs=1,
           dag_id='current_dag'
   ) as dag:
   
       step1 = DummyOperator(task_id='dummy_task')
   
       trigger_self = TriggerDagRunOperator(task_id='trigger_self', 
trigger_dag_id='current_dag')
   
       step1 >> trigger_self
   ```
   
   
   `[2021-09-08 12:53:35,094] {dagrun.py:604} WARNING - Failed to record 
duration of <DagRun current_dag @ 2021-01-04 03:00:11+00:00: 
backfill__2021-01-04T03:00:11+00:00, externally triggered: False>: start_date 
is not set.`
   
   
   ### 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