Логотип Debug Spark Failure

Debug Spark Failure

Организация
EmbrasureAI
debug-spark-failure

Diagnose failed Apache Spark and PySpark applications from History Server evidence, logs, and cluster-manager state. Use for driver or executor crashes, out-of-memory errors, fetch failures, task exceptions, timeouts, repeated retries, aborted stages, and intermittent production failures.

Обзор

ИздательEmbrasureAI
Репозиторийspark-observability-skills
Название навыкаdebug-spark-failure
Звёзды
54
Форки
14
Файлы в комплекте
1
ЛицензияApache-2.0
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 1

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — EmbrasureAI. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Debug Spark Failure в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/EmbrasureAI/spark-observability-skills/tree/main/skills/debug-spark-failure
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/EmbrasureAI/spark-observability-skills.git /tmp/spark-observability-skills
mkdir -p .claude/skills
cp -r /tmp/spark-observability-skills/skills/debug-spark-failure .claude/skills/debug-spark-failure
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Debug Spark Failure в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Debug Spark Failure, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Debug Spark Failure не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Debug a Spark failure

Find the root cause: the earliest failure that explains the rest of the chain. Later fetch failures, retries, and executor loss are usually fallout, not cause.

Get the evidence

bash
export SPARK_HISTORY_URL="https://history.example.com"
python3 scripts/spark_history_api.py applications --status completed --limit 20
python3 scripts/spark_history_api.py failure --app-id <application-id> > /tmp/spark-failure.json

Run from this skill directory. If SPARK_HISTORY_URL is unset, find the server before asking the user: try http://localhost:18080, a running application's UI on http://localhost:4040, and the history-server or eventLog settings in the local Spark config; ask only when nothing responds. Authentication comes from SPARK_HISTORY_AUTHORIZATION, SPARK_HISTORY_COOKIE, or SPARK_HISTORY_HEADERS_JSON; never ask for credentials in chat and never disable TLS verification (--ca-file for a private CA).

Other subcommands: slow --app-id <id> for longest-stage distributions, sql-list / sql --app-id <id> --execution-id <n> for the executed plan; all accept --stage-limit N --task-limit N. For anything the profiles omit, call $SPARK_HISTORY_URL/api/v1 directly with the same auth headers: /applications/{app}/jobs, /stages/{stage}/{attempt}/taskSummary?quantiles=0.05,0.5,0.95, /stages/{stage}/{attempt}/taskList?status=failed, /allexecutors, /environment.

The History Server has no driver logs or container termination reasons: read spark.master and spark.submit.deployMode from environment.sparkProperties to locate them, then pull the driver log around the first exception, the first failing executor's log (kubectl logs --previous, yarn logs -applicationId, or the platform's log store), and the cluster manager's reason for any lost container. A driver crash can leave no failed Spark job at all. In taskSummary, metric arrays align with quantiles: the middle entry is the median, the last is the max.

Likeliest causes, in order, and how to check each

  1. Executor OOM. Dead executors and why they were removed:

    bash
    jq '.allExecutors[] | select(.isActive | not) | {id, hostPort, removeReason}' /tmp/spark-failure.json

    The decisive record is the cluster manager's exit code: kubectl describe pod <executor-pod> (137 / OOMKilled) or the YARN container exit status. Then run the skew check below: one oversized partition or join state is the usual cause, not globally low memory.

  2. Skew surfacing as failure. The task that dies is the one with far more data than the median:

    bash
    jq '.failedStages[] | {stage: .stage.stageId, quantiles: .taskSummary.quantiles, run: .taskSummary.executorRunTime, input: .taskSummary.inputMetrics.bytesRead, shuffleRead: .taskSummary.shuffleReadMetrics.readBytes}' /tmp/spark-failure.json

    If max is many times median, fix the key distribution, not the resources.

  3. Fetch failures. The error names the executor and shuffle block that could not be fetched:

    bash
    jq '.failedStages[].tasks[] | select(.errorMessage != null) | {index, host, executorId, err: .errorMessage[0:200]}' /tmp/spark-failure.json

    Look the named executor up in allExecutors for its removeReason and diagnose its earlier death from its own log; the fetch errors are fallout. If environment shows Celeborn or an external shuffle service, confirm in the driver log it actually served that shuffle; clients can fall back to built-in shuffle.

  4. Flaky infrastructure. Failures clustered on one host point at infrastructure; on one partition, at data:

    bash
    jq '[.failedStages[].tasks[] | select(.errorMessage != null)] | group_by(.host) | map({host: .[0].host, failures: length})' /tmp/spark-failure.json

    For a suspect host, check node events (kubectl get events, cluster-manager node state), spot preemption, and disk or network errors in that executor's log. Tasks that later succeeded on retry confirm flakiness rather than bad data.

  5. Deterministic data or code failure. Same exception at the same partition on every attempt:

    bash
    jq '[.failedStages[].tasks[] | select(.errorMessage != null)] | group_by(.index) | map({partition: .[0].index, attempts: length, err: .[0].errorMessage[0:120]})' /tmp/spark-failure.json

    Corrupt input, a pathological record, or a user-code bug; the partition identity is your reproduction.

  6. Python worker death. Filter the same task samples for Python worker in err; the traceback is in that executor's stderr, and spark.executor.pyspark.memory in environment.sparkProperties bounds worker memory.

  7. Driver failure. jq '.failedJobs | length' /tmp/spark-failure.json returning 0 for a failed app means the driver died: read the end of the driver log. Large collect, broadcast, or result sizes and very high partition counts (task-metadata bloat) are common; a GC-stalled driver also produces heartbeat storms in executor logs.

  8. Timeouts. Heartbeat and RPC timeouts in err are almost always secondary: cross-check executor GC (jq '.allExecutors[] | {id, gc: .totalGCTime, dur: .totalDuration}') and the skew check to find what was actually slow instead of raising the timeout.

  9. Commit or write failure. Committer and destination errors are in the driver log (grep -iE 'commit|abort' <driver-log>) and the task samples: look for concurrent writers, retried stages double-committing, permissions, and storage throttling.

The commands above are starting points, not limits: compose your own jq, call the REST API directly, or pull logs, code, and platform state when a question needs it. Rule each candidate in or out with evidence, and when a signal is suggestive but not conclusive, go a level deeper (more task samples, the exact log lines, the executed plan) until you are confident it is or is not the cause. Do not settle for the first plausible explanation.

Before concluding, merge the driver log, executor logs, and platform events into one timeline and take the earliest error that explains the rest. Configuration proves intent, not behavior; prefer runtime evidence.

Report

State the root cause and confidence, the failure chain from it, the evidence for and against, the smallest fix or reproduction, and what evidence was missing. Say "confirmed" only when logs or a reproduction establish causality; otherwise "leading hypothesis". Do not change production configuration or rerun expensive jobs without approval.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Debug Spark Failure?

Diagnose failed Apache Spark and PySpark applications from History Server evidence, logs, and cluster-manager state. Use for driver or executor crashes, out-of-memory errors, fetch failures, task exceptions, timeouts, repeated retries, aborted stages, and intermittent production failures.

Зачем использовать Debug Spark Failure в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Debug Spark Failure — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Debug Spark Failure в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/EmbrasureAI/spark-observability-skills/tree/main/skills/debug-spark-failure. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Debug Spark Failure?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Debug Spark Failure?

С любым количеством. В TypingMind вы можете использовать Debug Spark Failure с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Debug Spark Failure?

Да. Навык опубликован на GitHub по лицензии Apache-2.0. Издатель — EmbrasureAI. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇