3

On Airflow 2 my dag is not showing on the UI, and I'm getting DAG Import Errors (...) for it. The error message is insufficient for me to debug (it's a custom operator, with a lot of custom logic - so I don't want to get into details of the error itself). On Airflow 1.X I could use cli:

airflow list_dags

to get more elaborated debug message, is there anything analogical on airflow 2 ? I'm looking for a cli command/UI option that will provide me with more elaborated error message, than the one I'm getting on the main screen of the webserver.

Grzegorz Skibinski
  • 12,624
  • 2
  • 11
  • 34

2 Answers2

2

As described in the Airlfow's documentation, to test DAG loading you can simply run:

python your-dag-file.py

If there is any problem during the DAG loading phase you will get a stack trace here.

The later sections also describe how to test custom operators.

SergiyKolesnikov
  • 7,369
  • 2
  • 26
  • 47
1

As explained in the upgrading manual the airflow list_dags has been changed to airflow dags list

The full syntax is:

airflow dags list [-h] [-o table, json, yaml] [-S SUBDIR]

for more information see docs

Elad Kalif
  • 14,110
  • 2
  • 17
  • 49
  • I see it's written like this, however it's definitely not the case in terms of logs - try it yourself - airflow 2 version provides literally a list only, whereas airflow 1 was providing pretty extensive logs. – Grzegorz Skibinski Apr 19 '21 at 10:12
  • 1
    please open a github issue https://github.com/apache/airflow/issues with examples and we will look into it – Elad Kalif Apr 19 '21 at 10:14