Challenge - 5 Problems
Airflow CLI Debugging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Check DAG Run Status
You run the command
airflow dags state example_dag 2023-06-01T00:00:00+00:00. What is the expected output if the DAG run succeeded?Attempts:
2 left
💡 Hint
The command shows the state of a specific DAG run at the given execution date.
✗ Incorrect
The
airflow dags state command returns the state of the DAG run. If it succeeded, the output is exactly 'success'.💻 Command Output
intermediate1:30remaining
Task Instance Log Retrieval
What output do you get when running
airflow tasks logs example_dag example_task 2023-06-01T00:00:00+00:00 if the log file for that task instance does not exist?Attempts:
2 left
💡 Hint
Airflow CLI handles missing logs gracefully with a message.
✗ Incorrect
If the log file is missing, Airflow CLI prints a friendly message indicating no logs found rather than a Python error.
🔀 Workflow
advanced2:00remaining
Order of Commands to Debug a Failed Task
Arrange the following Airflow CLI commands in the correct order to debug a failed task instance:
Attempts:
2 left
💡 Hint
Start by confirming the DAG exists, then list tasks, check task state, then view logs.
✗ Incorrect
First list DAGs to confirm the DAG exists (3), then list tasks in the DAG (4), check the task state (1), and finally view logs for details (2).
❓ Troubleshoot
advanced1:30remaining
Identifying Cause of CLI Connection Error
You run
airflow dags list but get the error: ConnectionRefusedError: [Errno 111] Connection refused. What is the most likely cause?Attempts:
2 left
💡 Hint
The CLI connects to the metadata database to list DAGs.
✗ Incorrect
The CLI needs to connect to the metadata database. If the database is down or unreachable, it raises ConnectionRefusedError.
✅ Best Practice
expert2:00remaining
Best Practice for Debugging Task Failures Using Airflow CLI
Which of the following is the best practice when using Airflow CLI to debug a task failure in production?
Attempts:
2 left
💡 Hint
Good debugging means understanding the failure before acting.
✗ Incorrect
The best practice is to first check the task state and logs to understand the failure cause before clearing or rerunning tasks.