debug-buttercup
trailofbits/skills
Kubernetes上で動作するButtercup CRS(Cyber Reasoning System)のデバッグを行います。ポッドのクラッシュ、再起動ループ、Redisの障害、リソースの逼迫、ディスクの飽和、DinDの問題、またはcrsネームスペースにおけるサービスの異常動作を診断する際に使用します。 以下のコンポーネントに関するトリアージ、ログ分析、キューの検査、および一般的な障害パターンを網羅しています:redis、fuzzer-bot、coverage-bot、seed-gen、patcher、build-bot、scheduler、task-server、task-downloader、program-model、litellm、 dind、tracer-bot、merger-bot、competition-api、pov-reprod
...すべて拡張します概要debug-buttercup
「debug-buttercup 」スキルは、Kubernetes上にデプロイされたButtercup Cyber Reasoning System(CRS)内の問題をトラブルシューティングおよび診断するために設計されています。 このスキルは、`crs` ネームスペースにおけるポッドのクラッシュ、再起動ループ、Redis の障害、リソースの逼迫、ディスクの飽和、Docker-in-Docker (DinD) に関する問題、およびその他のサービスの異常動作の根本原因を特定することに重点を置いています。 体系的なトリアージとログ分析を提供することで、エンジニアが障害の原因を特定し、システム全体のダウンタイムを削減できるよう支援します。
このスキルは、ポッドの状態確認、イベントの確認、ログの検査、および実際のリソース制限と意図された構成の比較など、トリアージワークフローのための機能を提供します。蓄積された再起動回数とアクティブな障害を区別し、過去および現在進行中の問題の両方の検出をサポートします。Debug-buttercup また、Redisの利用不能など単一のサービス障害が広範囲にわたる再起動を引き起こす「連鎖的な障害」の検出も容易にします。ユーザーはすべてのレプリカにわたるログを分析したり、ライブログをストリーミングしたり、詳細な調査のためにログをディスクに収集したりできます。さらに、ポッドおよびノードレベルでのリソース負荷チェック機能も備えており、CPU、メモリ、ディスクの制約を特定できます。
このスキルは、システムの安定性を維持し、インシデントを迅速に解決する必要がある、Kubernetesオペレーター、サイト信頼性エンジニア、およびButtercup CRSを利用する開発者に最適です。 代表的なユースケースとしては、予期せぬポッドの再起動の調査、応答しないサービスの診断、キューの進行状況の確認、ヘルスチェックの失敗のトラブルシューティングなどが挙げられます。debug-buttercup は、`crs`ネームスペース内の障害をターゲットにすることで、無関係なデプロイメントやパフォーマンスチューニング作業に影響を与えることなく、的を絞った効率的な問題解決を実現します。
よくある質問
debug-buttercup はどのような場合に使用すべきですか?
`crs` ネームスペース内のポッドがクラッシュしたり、予期せず再起動したり、リソース不足に陥ったりした場合、あるいは Redis などのサービスが応答しなくなった場合に、このスキルを使用してください。また、キューの停滞、DinD の失敗、スケジューラの問題、および CRS システムにおけるその他の異常動作の診断にも役立ちます。
debug-buttercup をCRSネームスペース外で使用できますか?
いいえ、このスキルは`crs` Kubernetesネームスペース内のサービスをデバッグするために特別に設計されています。他のネームスペースでの問題については、標準的なKubernetesのトラブルシューティング手法や、その他の適切なツールを使用してください。
debug-buttercup はデプロイやアップグレードに対応していますか?
いいえ、Buttercupのデプロイやアップグレードを目的としたものではありません。デプロイやアップグレードのタスクは、Helmおよび公式のデプロイガイドに従って実行してください。
debug-buttercup は連鎖的な障害に対してどのように役立ちますか?
Redisのダウンなど、複数のPodの再起動を引き起こす可能性のある共有依存関係の障害を特定します。サービス横断的な `--previous` ログを分析することで、エンジニアは個々のPodではなく根本原因の特定に集中できるようになります。
このスキルにはリソースチェック機能が含まれていますか?
はい、debug-buttercup には、Podレベルおよびノードレベルの両方でCPU、メモリ、ディスクの使用状況を検査するコマンドが含まれており、リソースに関連する障害原因の特定に役立ちます。
Debug Buttercup
When to Use
- Pods in the
crsnamespace are in CrashLoopBackOff, OOMKilled, or restarting - Multiple services restart simultaneously (cascade failure)
- Redis is unresponsive or showing AOF warnings
- Queues are growing but tasks are not progressing
- Nodes show DiskPressure, MemoryPressure, or PID pressure
- Build-bot cannot reach the Docker daemon (DinD failures)
- Scheduler is stuck and not advancing task state
- Health check probes are failing unexpectedly
- Deployed Helm values don't match actual pod configuration
When NOT to Use
- Deploying or upgrading Buttercup (use Helm and deployment guides)
- Debugging issues outside the
crsKubernetes namespace - Performance tuning that doesn't involve a failure symptom
Namespace and Services
All pods run in namespace crs. Key services:
| Layer | Services |
|---|---|
| Infra | redis, dind, litellm, registry-cache |
| Orchestration | scheduler, task-server, task-downloader, scratch-cleaner |
| Fuzzing | build-bot, fuzzer-bot, coverage-bot, tracer-bot, merger-bot |
| Analysis | patcher, seed-gen, program-model, pov-reproducer |
| Interface | competition-api, ui |
Triage Workflow
Always start with triage. Run these three commands first:
# 1. Pod status - look for restarts, CrashLoopBackOff, OOMKilledkubectl get pods -n crs -o wide# 2. Events - the timeline of what went wrongkubectl get events -n crs --sort-by='.lastTimestamp'# 3. Warnings only - filter the noisekubectl get events -n crs --field-selector type=Warning --sort-by='.lastTimestamp'
Then narrow down:
# Why did a specific pod restart? Check Last State Reason (OOMKilled, Error, Completed)kubectl describe pod -n crs <pod-name> | grep -A8 'Last State:'# Check actual resource limits vs intendedkubectl get pod -n crs <pod-name> -o jsonpath='{.spec.containers[0].resources}'# Crashed container's logs (--previous = the container that died)kubectl logs -n crs <pod-name> --previous --tail=200# Current logskubectl logs -n crs <pod-name> --tail=200
Historical vs Ongoing Issues
High restart counts don't necessarily mean an issue is ongoing -- restarts accumulate over a pod's lifetime. Always distinguish:
--tailshows the end of the log buffer, which may contain old messages. Use--since=300sto confirm issues are actively happening now.--timestampson log output helps correlate events across services.- Check
Last Statetimestamps indescribe podto see when the most recent crash actually occurred.
Cascade Detection
When many pods restart around the same time, check for a shared-dependency failure before investigating individual pods. The most common cascade: Redis goes down -> every service gets ConnectionError/ConnectionRefusedError -> mass restarts. Look for the same error across multiple --previous logs -- if they all say redis.exceptions.ConnectionError, debug Redis, not the individual services.
Log Analysis
# All replicas of a service at oncekubectl logs -n crs -l app=fuzzer-bot --tail=100 --prefix# Stream livekubectl logs -n crs -l app.kubernetes.io/name=redis -f# Collect all logs to disk (existing script)bash deployment/collect-logs.sh
Resource Pressure
# Per-pod CPU/memorykubectl top pods -n crs# Node-levelkubectl top nodes# Node conditions (disk pressure, memory pressure, PID pressure)kubectl describe node <node> | grep -A5 Conditions# Disk usage inside a podkubectl exec -n crs <pod> -- df -h# What's eating diskkubectl exec -n crs <pod> -- sh -c 'du -sh /corpus/* 2>/dev/null'kubectl exec -n crs <pod> -- sh -c 'du -sh /scratch/* 2>/dev/null'
Redis Debugging
Redis is the backbone. When it goes down, everything cascades.
# Redis pod statuskubectl get pods -n crs -l app.kubernetes.io/name=redis# Redis logs (AOF warnings, OOM, connection issues)kubectl logs -n crs -l app.kubernetes.io/name=redis --tail=200# Connect to Redis CLIkubectl exec -n crs <redis-pod> -- redis-cli# Inside redis-cli: key diagnosticsINFO memory # used_memory_human, maxmemoryINFO persistence # aof_enabled, aof_last_bgrewrite_status, aof_delayed_fsyncINFO clients # connected_clients, blocked_clientsINFO stats # total_connections_received, rejected_connectionsCLIENT LIST # see who's connectedDBSIZE # total keys# AOF configurationCONFIG GET appendonly # is AOF enabled?CONFIG GET appendfsync # fsync policy: everysec, always, or no# What is /data mounted on? (disk vs tmpfs matters for AOF performance)
kubectl exec -n crs <redis-pod> -- mount | grep /datakubectl exec -n crs <redis-pod> -- du -sh /data/
Queue Inspection
Buttercup uses Redis streams with consumer groups. Queue names:
| Queue | Stream Key |
|---|---|
| Build | fuzzer_build_queue |
| Build Output | fuzzer_build_output_queue |
| Crash | fuzzer_crash_queue |
| Confirmed Vulns | confirmed_vulnerabilities_queue |
| Download Tasks | orchestrator_download_tasks_queue |
| Ready Tasks | tasks_ready_queue |
| Patches | patches_queue |
| Index | index_queue |
| Index Output | index_output_queue |
| Traced Vulns | traced_vulnerabilities_queue |
| POV Requests | pov_reproducer_requests_queue |
| POV Responses | pov_reproducer_responses_queue |
| Delete Task | orchestrator_delete_task_queue |
# Check stream length (pending messages)kubectl exec -n crs <redis-pod> -- redis-cli XLEN fuzzer_build_queue# Check consumer group lagkubectl exec -n crs <redis-pod> -- redis-cli XINFO GROUPS fuzzer_build_queue# Check pending messages per consumerkubectl exec -n crs <redis-pod> -- redis-cli XPENDING fuzzer_build_queue build_bot_consumers - + 10# Task registry sizekubectl exec -n crs <redis-pod> -- redis-cli HLEN tasks_registry# Task state countskubectl exec -n crs <redis-pod> -- redis-cli SCARD cancelled_taskskubectl exec -n crs <redis-pod> -- redis-cli SCARD succeeded_taskskubectl exec -n crs <redis-pod> -- redis-cli SCARD errored_tasks
Consumer groups: build_bot_consumers, orchestrator_group, patcher_group, index_group, tracer_bot_group.
Health Checks
Pods write timestamps to /tmp/health_check_alive. The liveness probe checks file freshness.
# Check health file freshnesskubectl exec -n crs <pod> -- stat /tmp/health_check_alivekubectl exec -n crs <pod> -- cat /tmp/health_check_alive
If a pod is restart-looping, the health check file is likely going stale because the main process is blocked (e.g. waiting on Redis, stuck on I/O).
Telemetry (OpenTelemetry / Signoz)
All services export traces and metrics via OpenTelemetry. If Signoz is deployed (global.signoz.deployed: true), use its UI for distributed tracing across services.
# Check if OTEL is configuredkubectl exec -n crs <pod> -- env | grep OTEL# Verify Signoz pods are running (if deployed)kubectl get pods -n platform -l app.kubernetes.io/name=signoz
Traces are especially useful for diagnosing slow task processing, identifying which service in a pipeline is the bottleneck, and correlating events across the scheduler -> build-bot -> fuzzer-bot chain.
Volume and Storage
# PVC statuskubectl get pvc -n crs# Check if corpus tmpfs is mounted, its size, and backing typekubectl exec -n crs <pod> -- mount | grep corpus_tmpfskubectl exec -n crs <pod> -- df -h /corpus_tmpfs 2>/dev/null# Check if CORPUS_TMPFS_PATH is setkubectl exec -n crs <pod> -- env | grep CORPUS# Full disk layout - what's on real disk vs tmpfskubectl exec -n crs <pod> -- df -h
CORPUS_TMPFS_PATH is set when global.volumes.corpusTmpfs.enabled: true. This affects fuzzer-bot, coverage-bot, seed-gen, and merger-bot.
Deployment Config Verification
When behavior doesn't match expectations, verify Helm values actually took effect:
# Check a pod's actual resource limitskubectl get pod -n crs <pod-name> -o jsonpath='{.spec.containers[0].resources}'# Check a pod's actual volume definitionskubectl get pod -n crs <pod-name> -o jsonpath='{.spec.volumes}'
Helm values template typos (e.g. wrong key names) silently fall back to chart defaults. If deployed resources don't match the values template, check for key name mismatches.
Service-Specific Debugging
For detailed per-service symptoms, root causes, and fixes, see references/failure-patterns.md.
Quick reference:
- DinD:
kubectl logs -n crs -l app=dind --tail=100-- look for docker daemon crashes, storage driver errors - Build-bot: check build queue depth, DinD connectivity, OOM during compilation
- Fuzzer-bot: corpus disk usage, CPU throttling, crash queue backlog
- Patcher: LiteLLM connectivity, LLM timeout, patch queue depth
- Scheduler: the central brain --
kubectl logs -n crs -l app=scheduler --tail=-1 --prefix | grep "WAIT_PATCH_PASS\|ERROR\|SUBMIT"
Diagnostic Script
Run the automated triage snapshot:
bash {baseDir}/scripts/diagnose.shPass --full to also dump recent logs from all pods:
bash {baseDir}/scripts/diagnose.sh --fullThis collects pod status, events, resource usage, Redis health, and queue depths in one pass.
すべてのファイル
3件のファイルdebug-buttercupをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/trailofbits/skills/blob/main/plugins/debug-buttercup/skills/debug-buttercup/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
コピー





家
