0
0
Apache Airflowdevops~20 mins

Debugging with Airflow CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Airflow CLI Debugging Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1: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?
Asuccess
Bfailed
Crunning
Dqueued
Attempts:
2 left
💡 Hint
The command shows the state of a specific DAG run at the given execution date.
💻 Command Output
intermediate
1: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?
ATask instance logs displayed successfully
BNo logs found for task instance example_task on 2023-06-01T00:00:00+00:00
CFileNotFoundError: [Errno 2] No such file or directory
DPermission denied error
Attempts:
2 left
💡 Hint
Airflow CLI handles missing logs gracefully with a message.
🔀 Workflow
advanced
2: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:
A3,1,4,2
B4,3,1,2
C3,4,1,2
D1,2,3,4
Attempts:
2 left
💡 Hint
Start by confirming the DAG exists, then list tasks, check task state, then view logs.
Troubleshoot
advanced
1: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?
AAirflow webserver is not running
BAirflow scheduler is not running
CAirflow CLI is outdated
DAirflow metadata database is down
Attempts:
2 left
💡 Hint
The CLI connects to the metadata database to list DAGs.
Best Practice
expert
2: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?
ACheck the task instance state, then review logs before deciding to clear or rerun
BDirectly clear the failed task instance using <code>airflow tasks clear</code> without checking logs
CRestart the entire Airflow scheduler to fix task failures
DIgnore CLI and only use the Airflow web UI for debugging
Attempts:
2 left
💡 Hint
Good debugging means understanding the failure before acting.