debugging-dags
БесплатноБез исполняемых скриптовНе проверенComprehensive DAG failure diagnosis and root-cause analysis with structured investigation and prevention recommendations. Use when deep failure investigation…
от astronomer★ 465 звёзд на GitHubОб этом скилле
DAG Diagnosis
You are a data engineer debugging a failed Airflow DAG. Follow this systematic approach to identify the root cause and provide actionable remediation.
Running the CLI
These commands assume af is on PATH. Run via astro otto to get it automatically, or install standalone with uv tool install astro-airflow-mcp.
Step 1: Identify the Failure
If a specific DAG was mentioned:
- Run
af runs diagnose <dag_id> <dag_run_id>(if run_id is provided) - If no run_id specified, run
af dags statsto find recent failures
If no DAG was specified:
- Run
af healthto find recent failures across all DAGs - Check for import errors with
af dags errors - Show DAGs with recent failures
- Ask which DAG to investigate further
Step 2: Get the Error Details
Once you have identified a failed task:
- Get task logs using
af tasks logs <dag_id> <dag_run_id> <task_id> - Look for the actual exception - scroll past the Airflow boilerplate to find the real error
- Categorize the failure type:
- Data issue: Missing data, schema change, null values, constraint violation
- Code issue: Bug, syntax error, import failure, type error
- Infrastructure issue: Connection timeout, resource exhaustion, permission denied
- Dependency issue: Upstream failure, external API down, rate limiting
Step 3: Check Context
Gather additional context to understand WHY this happened:
- Recent changes: Was there a code deploy? Check git history if available
- Package version changes: Was a package upgraded — in the image, in a venv-style operator, or at the index? See Package version changes below.
- Data volume: Did data volume spike? Run a quick count on source tables
- Upstream health: Did upstream tasks succeed but produce unexpected data?
- Historical pattern: Is this a recurring failure? Check if same task failed before
- Timing: Did this fail at an unusual time? (resource contention, maintenance windows)
Use af runs get <dag_id> <dag_run_id> to compare the failed run against recent successful runs.
Package version changes
A common cause of failures with no git activity is dependency drift — the user's code didn't change, but a package they depend on did. Check in this order:
Worker image diff (preferred when available). Every Astro deploy = new image tag, so the registry has a "before" and "after". Diff
pip freezebetween current and previous image — that's ground truth for what changed:docker run --rm <current_image> pip freeze > /tmp/now.txt docker run --rm <previous_image> pip freeze > /tmp/prev.txt diff /tmp/prev.txt /tmp/now.txtAlso compare
docker run --rm <image> python --versionbetween the two — a Python minor-version bump (3.11 → 3.12, or even a patch) can break wheel compatibility even whenpip freezelooks identical.af config providerslists currently installed provider versions, useful for cross-checking against modules named in the traceback.Venv-style operators bypass the worker image.
@task.virtualenv,PythonVirtualenvOperator,ExternalPythonOperator, andKubernetesPodOperatorbuild their environment per task run, so an image diff won't catch failures inside them. If the failed task is one of these, read itsrequirements/image/python_version/pythonargs directly:- Unbounded specifier (e.g.
pandas>=2.0.0with no upper bound, or no specifier at all) → a new upstream release is the prime suspect. image="foo:latest"or no tag → the image moved underneath you.python_version="3.11"(on@task.virtualenv/PythonVirtualenvOperator) or apythonpath (onExternalPythonOperator) resolving to a different interpreter than it used to — a Python minor-version change can break wheel compatibility for unchangedrequirements. Same vector applies to the worker image itself if the base Python changed there.
Fix is to pin:
pandas>=2.0.0,<3.0.0, a lockfile, a specific image SHA, or a fully-qualified Python version (python_version="3.11.7"instead of"3.11").- Unbounded specifier (e.g.
Index lookup when image diff isn't conclusive (no image history, or a venv-style operator). Identify the configured index first — it may not be PyPI:
- Env vars:
UV_INDEX_URL,PIP_INDEX_URL,PIP_EXTRA_INDEX_URL pyproject.toml→tool.uv.index~/.pip/pip.conf,/etc/pip.confDockerfile--index-urlflags
Then query for releases of the suspect package since the first failure started. PyPI:
curl -s https://pypi.org/pypi/<pkg>/json | jq '.releases | to_entries | map({version: .key, uploaded: .value[0].upload_time}) | sort_by(.uploaded) | reverse | .[:5]'Private indexes usually expose the same
/pypi/<pkg>/jsonshape; fall back to the Simple API (/simple/<pkg>/) or ask the user if neither works.- Env vars:
A release timestamp landing between the last green run and the first red
Установить debugging-dags в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл debugging-dags?
Comprehensive DAG failure diagnosis and root-cause analysis with structured investigation and prevention recommendations. Use when deep failure investigation is needed, a DAG fails to import/parse or 'airflow dags list' errors on a file; a task or run is failing and must be diagnosed and fixed; requests like 'why did X fail', 'my dag keeps failing — find and fix it', or fixing a broken DAG so it loads cleanly. For simple 'why did it fail / show logs', the airflow skill handles it directly.
Как установить скилл debugging-dags?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл debugging-dags запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic