tirkarthi commented on issue #30866: URL: https://github.com/apache/airflow/issues/30866#issuecomment-1522112443
I get the below error with the sample. I guess the task is not even executed since you are using a dynamic datetime which is always current time and mixing traditional operators with taskflow. Please check https://forum.astronomer.io/t/dag-run-marked-as-success-but-no-tasks-even-started/1423 ```python import datetime from airflow.decorators import task from airflow.models.dag import dag from airflow.operators.trigger_dagrun import TriggerDagRunOperator from airflow import DAG with DAG( schedule=None, catchup=False, start_date=datetime.datetime(2022, 1, 2), dag_id="my_dag_trigger", ) as dag: TriggerDagRunOperator( task_id="my_task", trigger_dag_id="bad", conf={"params": {"name": "foo!!!"}} ) ``` ``` laptop *** Found local files: *** * /home/karthikeyan/airflow/logs/dag_id=my_dag_trigger/run_id=manual__2023-04-25T16:46:31.586901+00:00/task_id=my_task/attempt=1.log [2023-04-25, 22:16:35 IST] {taskinstance.py:1144} INFO - Dependencies all met for dep_context=non-requeueable deps ti=<TaskInstance: my_dag_trigger.my_task manual__2023-04-25T16:46:31.586901+00:00 [queued]> [2023-04-25, 22:16:35 IST] {taskinstance.py:1144} INFO - Dependencies all met for dep_context=requeueable deps ti=<TaskInstance: my_dag_trigger.my_task manual__2023-04-25T16:46:31.586901+00:00 [queued]> [2023-04-25, 22:16:35 IST] {taskinstance.py:1345} INFO - Starting attempt 1 of 1 [2023-04-25, 22:16:35 IST] {taskinstance.py:1364} INFO - Executing <Task(TriggerDagRunOperator): my_task> on 2023-04-25 16:46:31.586901+00:00 [2023-04-25, 22:16:35 IST] {standard_task_runner.py:57} INFO - Started process 13752 to run task [2023-04-25, 22:16:35 IST] {standard_task_runner.py:84} INFO - Running: ['airflow', 'tasks', 'run', 'my_dag_trigger', 'my_task', 'manual__2023-04-25T16:46:31.586901+00:00', '--job-id', '43', '--raw', '--subdir', 'DAGS_FOLDER/gh30866.py', '--cfg-path', '/tmp/tmpstx9yjjg'] [2023-04-25, 22:16:35 IST] {standard_task_runner.py:85} INFO - Job 43: Subtask my_task [2023-04-25, 22:16:35 IST] {task_command.py:410} INFO - Running <TaskInstance: my_dag_trigger.my_task manual__2023-04-25T16:46:31.586901+00:00 [running]> on host laptop [2023-04-25, 22:16:35 IST] {taskinstance.py:1586} INFO - Exporting env vars: AIRFLOW_CTX_DAG_OWNER='airflow' AIRFLOW_CTX_DAG_ID='my_dag_trigger' AIRFLOW_CTX_TASK_ID='my_task' AIRFLOW_CTX_EXECUTION_DATE='2023-04-25T16:46:31.586901+00:00' AIRFLOW_CTX_TRY_NUMBER='1' AIRFLOW_CTX_DAG_RUN_ID='manual__2023-04-25T16:46:31.586901+00:00' [2023-04-25, 22:16:35 IST] {taskinstance.py:1863} ERROR - Task failed with exception Traceback (most recent call last): File "/home/karthikeyan/stuff/python/airflow/.env/lib/python3.10/site-packages/airflow/operators/trigger_dagrun.py", line 150, in execute dag_run = trigger_dag( File "/home/karthikeyan/stuff/python/airflow/.env/lib/python3.10/site-packages/airflow/api/common/trigger_dag.py", line 119, in trigger_dag raise DagNotFound(f"Dag id {dag_id} not found in DagModel") airflow.exceptions.DagNotFound: Dag id bad not found in DagModel [2023-04-25, 22:16:35 IST] {taskinstance.py:1382} INFO - Marking task as FAILED. dag_id=my_dag_trigger, task_id=my_task, execution_date=20230425T164631, start_date=20230425T164635, end_date=20230425T164635 [2023-04-25, 22:16:35 IST] {standard_task_runner.py:104} ERROR - Failed to execute job 43 for task my_task (Dag id bad not found in DagModel; 13752) [2023-04-25, 22:16:35 IST] {local_task_job_runner.py:232} INFO - Task exited with return code 1 [2023-04-25, 22:16:35 IST] {taskinstance.py:2694} INFO - 0 downstream tasks scheduled from follow-on schedule check ``` -- 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]
