Skip to main content
πŸ“˜ Complete PDF

Apache Airflow Certification Practice Test 04

Production Support Troubleshooting Scenarios

Question 1 of 20
πŸ“‹ Multiple Choice
Question 61
A newly joined Airflow Support Engineer receives an automated high-severity PagerDuty alert at 03:00 AM indicating that a critical financial DAG failed during its nightly run. What is the FIRST diagnostic action the support engineer should take to determine the root cause of the failure?
A. Reboot all Kubernetes worker nodes immediately
B. Delete the DAG file from the Git repository
C. Manually drop and recreate the Airflow metadata database
βœ“
D. Inspect the Task Execution Logs of the failed task instance in the Airflow Web UI
Answer
βœ… D. Inspect the Task Execution Logs of the failed task instance in the Airflow Web UI
Explanation

1. Concept Overview Production incident response requires disciplined root-cause diagnosis before attempting remediation. In Apache Airflow, task instances capture comprehensive standard output (`stdout`), standard error (`stderr`), and Python tracebacks directly into **Task Execution Logs**.

2. Why the Correct Option is Right **Inspecting the Task Execution Logs of the failed task instance** is the mandatory first step. By opening the Airflow UI, clicking the red failed task square in Grid View, and selecting 'Log', the engineer views the exact Python traceback, SQL error message, or API status code. This pinpoints whether the failure was caused by bad data, network timeouts, authentication issues, or code bugs.

3. Why Other Options Are Incorrect - **Rebooting all worker nodes:** Disrupts all other concurrently running pipelines across the company without diagnosing the actual problem. - **Deleting the DAG file:** Destroys pipeline availability and history; not a valid troubleshooting response. - **Dropping and recreating metadata database:** Catastrophic action that destroys all pipeline metadata, historical run records, connections, and variables.

4. Production Scenario / Code Example

text
-- Navigating to logs in the Airflow UI:
-- 1. Click the DAG name: 'financial_nightly_ledger'
-- 2. In Grid View, identify the red column (failed DAG run)
-- 3. Click the red task node: 'validate_ledger_entries'
-- 4. Click 'Log' tab in the right-hand inspection drawer
-- 5. Read the exact exception:
[2024-06-15, 03:02:14 UTC] {taskinstance.py:1851} ERROR - Task failed with exception
psycopg2.OperationalError: could not connect to server: Connection refused
	Is the server running on host "db.internal" (10.0.1.5) and accepting
	TCP/IP connections on port 5432?

5. Real-World Architecture Context In modern SRE (Site Reliability Engineering) and DataOps practices, jumping to restart infrastructure without reading logs wastes time and destroys ephemeral diagnostic clues. Logs provide non-repudiable evidence for incident post-mortems.

6. Common Pitfalls & Anti-Patterns - **Clearing and re-running without checking logs:** Clicking "Clear" to retry a task before understanding the error can corrupt downstream data if the failure was caused by upstream schema changes. - **Missing remote log configuration:** In containerized environments (KubernetesExecutor), task logs must be written to S3 or GCS; otherwise, pod termination deletes local logs.

7. Performance & Cost Considerations Fast root-cause identification via task logs minimizes Mean Time to Resolution (MTTR) and prevents SLA penalties.

8. Exam / Interview Tip When an exam scenario asks for the *first step* in troubleshooting a failed task, the answer is ALWAYS: **Check / Review the Task Logs**.

9. Key Takeaways - Always inspect task logs first during incident triage. - Logs capture the exact Python traceback and external system error messages. - Avoid restarting services or clearing tasks blindly before reading the logs.

10. Related Tutorials & Resources - [Airflow Logs & Log Retention Policies](/tutorials/airflow/airflow-logs-and-log-retention-policies) - [Airflow UI Guide β€” DAGs, Graph, Grid, Logs](/tutorials/airflow/airflow-ui-guide)`

Answered: 0 / 20
Question Navigator (Test 04)0% Answered