ivanshamaev/de-agent-skills/de-rca

Claude Code and agent skill by ivanshamaev/de-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

DE pipeline root cause analysis — failure taxonomy, lineage tracing, upstream/downstream impact, log analysis patterns, Airflow/Spark/dbt failure diagnosis, data quality anomaly RCA, 5-Whys template, incident timeline reconstruction, runbook-style investigation checklists

Install

npx vskill@latest install ivanshamaev/de-agent-skills/de-rca

SKILL.md

The same SKILL.md was published earlier as ivanshamaev/de-agent-skills/de-rca.

DE Root Cause Analysis

When to Use

Load this skill when the user needs to:

  • Triage a failing or stuck data pipeline (Airflow DAG, Spark job, dbt run)
  • Investigate a data quality incident — wrong numbers, missing rows, duplicates, nulls
  • Analyze an SLA breach — pipeline ran but finished too late
  • Respond to a production incident — unexpected data anomaly reported by stakeholders
  • Trace blast radius — which downstream tables/dashboards/jobs are affected by a bad upstream table
  • Write an RCA document or post-mortem after resolving an incident
  • Build investigation checklists and runbooks for on-call engineers

1. Failure Taxonomy

Correctly classifying the failure type determines the fastest investigation path. Misclassifying (e.g., treating a logic bug as an infrastructure problem) wastes hours.

1.1 Infrastructure Failures
SymptomLikely CauseFirst Check
java.lang.OutOfMemoryError: Java heap spaceExecutor OOMSpark executor memory, data skew
Container killed by YARN for exceeding memory limitsCluster container evictionspark.executor.memoryOverhead, partition count
No space left on deviceDisk full on worker or shuffle dir/tmp usage, shuffle spill, HDFS quota
Connection refused / Connection timed outNetwork partition, service downVPC routing, security groups, DNS
Task preemptedCluster eviction (spot/preemptible)Cloud provider events, spot interruption notices
Disk I/O errorStorage hardware failureCloud disk health, HDFS block scan
1.2 Data Failures
SymptomLikely CauseFirst Check
Row count dropped 50%+ vs yesterdayMissing source data, source job failedSource system logs, upstream DAG status
Unexpected NULLs in non-nullable columnsSchema drift in source, ETL bugSource schema changelog, sample the staging table
Primary key violationsDuplicate data at source, re-ingestion overlapDedup logic, incremental filter range
Referential integrity broken (FK mismatches)Out-of-order load, missing dimension rowDimension load order, late-arriving dims
Volume 10x larger than normalRe-ingestion of historical data, filter removedSource query, watermark/cursor value
1.3 Logic Failures
SymptomLikely CauseFirst Check
Off-by-one in daily partitionDate filter uses < today instead of <= yesterdayCheck WHERE clause boundary conditions
Wrong aggregation totalsJoin fan-out (many-to-many producing extra rows)Count rows before/after join
Timezone mismatchPipeline runs in UTC, business logic expects local timeCONVERT_TZ, AT TIME ZONE, DST transitions
Incorrect incremental logicis_incremental() filter reads wrong watermark columndbt model SQL, max(updated_at) vs max(created_at)
Negative revenue, impossible valuesSign inversion, unit mismatch (cents vs dollars)Compare raw source values vs transformed
1.4 Dependency Failures
SymptomLikely CauseFirst Check
Task stuck in queued state for hoursUpstream DAG not finished; ExternalTaskSensor waitingParent DAG run status in Airflow UI
Empty table after successful runUpstream API returned 200 but empty payloadAPI response sample, rate-limit headers
Kafka consumer 6h behindProducer spike or consumer slowdownConsumer lag (kafka-consumer-groups.sh), topic throughput
API call returns 503/429External service overloaded or rate-limitedHTTP response codes in logs, Retry-After header
1.5 Configuration Failures
SymptomLikely CauseFirst Check
OperationalError: could not connect to serverWrong host/port in connection stringAirflow connection ID value, env var override
KeyError: 'DB_PASSWORD'Missing environment variable in deployed environmentSecret manager, Kubernetes secret mount
AnalysisException: Table not foundWrong schema/database prefix, wrong environmentspark.catalog.currentDatabase(), connection config
Wrong partition overwrittenPartition key column name changedpartitionBy argument vs actual column name
Wrong S3 bucket (dev data in prod)Environment variable not injectedCompare ENVIRONMENT env var with actual path
1.6 Concurrency Failures
SymptomLikely CauseFirst Check
Duplicate rows after concurrent runsTwo DAG runs writing same partition simultaneouslyAirflow max_active_runs, file-level locking
LockWaitTimeout / DeadlockDetectedTwo writers competing on same table/rowPostgreSQL pg_locks, transaction isolation level
Partial data after apparent successRace between writer and reader on non-ACID storageUse ACID table format (Delta/Iceberg), two-phase write
XCom overwritten by parallel taskTwo tasks pushing to the same XCom keyUnique XCom keys per task instance

2. Investigation Framework — 5-Step RCA Process

Step 1: Timeline Reconstruction

The timeline is the foundation of all RCA. Establish three timestamps first:

  1. Event time — when did the bad data/failure actually occur in the data?
  2. Detection time — when did a monitor, alert, or human notice?
  3. Impact time — when did downstream consumers first see the problem?
sql
-- Airflow: find first failure for a DAG in the last 7 days
SELECT
dag_id,
run_id,
execution_date,
state,
start_date,
end_date,
(end_date - start_date) AS duration
FROM dag_run
WHERE dag_id = 'orders_etl'
AND execution_date >= NOW() - INTERVAL '7 days'
ORDER BY execution_date DESC;
-- Find which task instance failed first in a run
SELECT
task_id,
state,
start_date,
end_date,
try_number,
hostname
FROM task_instance
WHERE dag_id = 'orders_etl'
AND run_id = 'scheduled__2024-06-01T00:00:00+00:00'
ORDER BY start_date;
Step 2: Blast Radius Assessment

Before digging into root cause, know what is broken. This prevents partial fixes and missed downstream alerts.

python
# Quick blast radius checklist
BLAST_RADIUS_QUESTIONS = [
"Which tables are directly written by the failing job?",
"Which dbt models SELECT from those tables?",
"Which dashboards/BI tools query those models?",
"Which downstream DAGs depend on this DAG (ExternalTaskSensor)?",
"Which SLAs are now at risk given current time?",
"Are any customer-facing APIs/reports backed by this data?",
]
bash
# dbt: find all models that depend on a broken source model
dbt ls --select "source:raw.orders+" --output path
# + suffix means "this node and all descendants"
# dbt: find direct and indirect dependents of a specific model
dbt ls --select "+stg_orders+" --output name
Step 3: Evidence Collection

Collect evidence before forming hypotheses — evidence is objective, hypotheses are not.

Checklist:

  • [ ] Task/job logs (full log, not just last N lines)
  • [ ] Row counts before and after the failing step
  • [ ] Sample of affected rows (5-20 rows is usually enough)
  • [ ] Metric graphs for the failure window (Grafana, CloudWatch, Datadog)
  • [ ] Schema of source and target tables at failure time
  • [ ] Git history of pipeline code — any deploy in the last 24h?
  • [ ] Infrastructure change log — cluster resize, config push, dependency upgrade?
  • [ ] Upstream system status page or on-call contact
Step 4: Hypothesis Generation and Elimination

Form hypotheses from the failure taxonomy (Section 1), then eliminate them systematically with evidence.

Hypothesis template:
"The failure was caused by [X] because [evidence Y] supports it.
It was NOT caused by [A] because [evidence B] rules it out."

Good elimination requires a binary question: "If hypothesis X is true, what observable artifact would exist?" If that artifact is absent, eliminate X.

Step 5: Root Cause Statement and Contributing Factors

A root cause statement is a single sentence using the because chain:

"The orders dashboard showed zero revenue on 2024-06-01 because the fact_orders dbt model produced zero rows because the incremental filter used updated_at > '{{ ds }}' with ds in UTC while source timestamps are in US/Eastern, excluding all rows written after 19:00 UTC the previous day."

Contributing factors are conditions that made the root cause possible or worse:

  • No data volume alert on fact_orders to catch the zero-row scenario
  • Timezone assumption was undocumented in the model's description
  • The issue was not caught in staging because the staging run uses a small sample

3. Airflow Failure Diagnosis

3.1 Task Log Location and Key Patterns
bash
# Default log path on Airflow worker
/opt/airflow/logs/<dag_id>/<task_id>/<execution_date>/<try_number>.log
# Kubernetes executor — fetch logs from pod
kubectl logs <pod-name> -n airflow -c base
# Grep for common failure signals in a task log
grep -E "(ERROR|CRITICAL|Traceback|Exception|killed|OOM|timeout)" task.log
# Find the actual exception line (last Traceback in log)
grep -n "Traceback" task.log | tail -1
# Then read from that line number
tail -n +<LINE> task.log | head -60

Structured log patterns to search (JSON logs):

bash
# jq: extract ERROR entries with timestamps
cat task.log | jq -r 'select(.level=="ERROR") | "\(.timestamp) \(.event // .message)"'
# jq: find the first error occurrence
cat task.log | jq -r 'select(.level=="ERROR") | .timestamp' | head -1
3.2 Task Instance State Machine
StateMeaningNext action
runningActively executingWait; check for hangs (no log output > 10 min)
failedRaised an exception, no retries leftCheck logs; fix and clear to re-run
up_for_retryFailed but retries remainWait for retry; check transient vs permanent
upstream_failedA task this depends on failedFix the upstream task first; then clear downstream
skippedUpstream used BranchOperator and chose a different pathExpected behavior; verify branch logic
up_for_rescheduleSensor in reschedule mode, condition not met yetCheck sensor poke condition; may need to investigate source
deferredTask deferred to triggerer (async sensor)Normal for deferrable operators; check triggerer logs
zombieWorker died without updating stateScheduler detects and marks failed; check worker health
sql
-- Find tasks stuck in running state for more than 2 hours (likely zombie)
SELECT dag_id, task_id, run_id, start_date, hostname
FROM task_instance
WHERE state = 'running'
AND start_date < NOW() - INTERVAL '2 hours';
-- Failure rate per task over last 30 days
SELECT
dag_id,
task_id,
COUNT(*) AS total_runs,
SUM(CASE WHEN state = 'failed' THEN 1 ELSE 0 END) AS failures,
ROUND(100.0 * SUM(CASE WHEN state = 'failed' THEN 1 ELSE 0 END) / COUNT(*), 2) AS failure_pct,
MAX(CASE WHEN state = 'failed' THEN start_date END) AS last_failure
FROM task_instance
WHERE start_date >= NOW() - INTERVAL '30 days'
GROUP BY dag_id, task_id
HAVING SUM(CASE WHEN state = 'failed' THEN 1 ELSE 0 END) > 0
ORDER BY failure_pct DESC;
3.3 DagBag Import Errors

DagBag errors prevent the DAG from appearing in the UI at all — the scheduler silently skips broken DAGs.

bash
# Reproduce a DagBag import error locally
python -c "
from airflow.models import DagBag
bag = DagBag(dag_folder='/opt/airflow/dags', include_examples=False)
for dag_id, err in bag.import_errors.items():
print(f'--- {dag_id} ---')
print(err)
"
# Or using the CLI
airflow dags list-import-errors
# Test a single DAG file directly
python /opt/airflow/dags/orders_etl.py

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ivanshamaev/de-agent-skills/de-rca/badge)](https://verified-skill.com/skills/ivanshamaev/de-agent-skills/de-rca)

Something wrong with this skill or its page? Tell us.