With /api/experimental/dags//dag_runs rest call, it retrieve status (success/fail). I need to fetch error if status is fail. is it possible to get it through any of airflow rest api call?
Asked
Active
Viewed 1,276 times
1
-
I don't think DAGs have any error; it is the tasks that have errors (stacktrace). Then i assume you want to fetch stacktraces of failed tasks. I can't find any such command in rest-api. I think the only way would be to configure [remote logging](https://airflow.apache.org/docs/stable/howto/write-logs.html) in Airflow and then use the corresponding logging system's API to fetch logs – y2k-shubham May 12 '20 at 14:46
-
Thanks for info. @y2k-shubham – Nitesh Patil May 13 '20 at 14:38
-
1by the way, you can retrieve exception message from `context` dictionary using `context.get('exception')`; check [this](https://stackoverflow.com/a/57871605/3679900) – y2k-shubham May 15 '20 at 07:48