debug-buttercup
trailofbits/skills
Kubernetes에서 실행 중인 Buttercup CRS(Cyber Reasoning System)를 디버깅합니다. crs 네임스페이스에서 발생하는 포드 충돌, 재시작 루프, Redis 오류, 리소스 부하, 디스크 포화, DinD 문제 또는 기타 서비스 이상 현상을 진단할 때 사용합니다. 다음 구성 요소에 대한 초기 진단, 로그 분석, 큐 검사 및 일반적인 오류 패턴을 다룹니다: 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 스킬은 쿠버네티스에 배포된 Buttercup Cyber Reasoning System(CRS) 내의 문제를 해결하고 진단하기 위해 설계되었습니다. 이 스킬은 `crs` 네임스페이스 내에서 발생하는 포드 중단, 재시작 루프, Redis 오류, 리소스 과부하, 디스크 포화, Docker-in-Docker(DinD) 문제 및 기타 서비스 이상 현상의 근본 원인을 파악하는 데 중점을 둡니다. 체계적인 문제 분류 및 로그 분석을 제공함으로써, 엔지니어가 오류 원인을 정확히 파악하고 시스템 전반의 다운타임을 줄이는 데 도움을 줍니다.
이 스킬은 포드 상태 확인, 이벤트 검토, 로그 검사, 실제 리소스 제한과 의도된 구성을 비교하는 등 트라이아지 워크플로우 기능을 제공합니다. 또한 누적된 재시작 횟수와 활성 오류를 구분하여 과거 및 현재 진행 중인 문제를 모두 감지할 수 있습니다. Debug-buttercup 또한 Redis 가용성 저하와 같은 단일 서비스 문제가 광범위한 재시작을 유발할 수 있는 연쇄적 장애 감지 기능도 지원합니다. 사용자는 모든 복제본에 걸친 로그를 분석하고, 실시간 로그를 스트리밍하며, 심층적인 검토를 위해 로그를 디스크에 수집할 수 있습니다. 또한 CPU, 메모리 및 디스크 제약 조건을 식별하기 위해 파드 및 노드 수준 모두에서 리소스 부하 점검 기능도 포함되어 있습니다.
이 스킬은 시스템 안정성을 유지하고 사고를 신속하게 해결해야 하는 쿠버네티스 운영자, 사이트 신뢰성 엔지니어(SRE), 그리고 Buttercup CRS를 사용하는 개발자에게 이상적입니다. 대표적인 사용 사례로는 예기치 않은 파드 재시작 조사, 응답하지 않는 서비스 진단, 큐 진행 상황 확인, 헬스 체크 실패 문제 해결 등이 있습니다. `crs` 네임스페이스 내의 오류를 대상으로 하는 ‘ debug-buttercup ’는 관련 없는 배포나 성능 튜닝 작업에 영향을 주지 않으면서 집중적이고 효율적인 문제 해결을 보장합니다.
자주 묻는 질문
debug-buttercup 는 언제 사용해야 하나요?
`crs` 네임스페이스 내의 파드가 중단되거나 예기치 않게 재시작되거나 리소스 압박을 겪는 경우, 또는 Redis와 같은 서비스가 응답하지 않을 때 이 스킬을 사용하십시오. 또한 CRS 시스템에서 발생하는 큐 정체, DinD 실패, 스케줄러 문제 및 기타 비정상적인 동작을 진단하는 데에도 유용합니다.
debug-buttercup 를 CRS 네임스페이스 외부에서도 사용할 수 있나요?
아니요, 이 스킬은 `crs` 쿠버네티스 네임스페이스 내의 서비스를 디버그하기 위해 특별히 설계되었습니다. 다른 네임스페이스의 문제의 경우, 표준 쿠버네티스 문제 해결 방법이나 기타 적절한 도구를 사용해야 합니다.
debug-buttercup 는 배포나 업그레이드를 처리하나요?
아니요, 이 스킬은 Buttercup을 배포하거나 업그레이드하기 위한 용도가 아닙니다. 배포 및 업그레이드 작업은 Helm과 공식 배포 가이드를 사용하여 수행해야 합니다.
debug-buttercup 는 연쇄 오류 해결에 어떻게 도움이 되나요?
이 도구는 Redis 중단과 같이 여러 포드의 재시작을 유발할 수 있는 공유 종속성 오류를 식별합니다. 서비스 전반의 `--previous` 로그를 분석함으로써, 엔지니어들이 개별 포드보다는 근본 원인에 집중할 수 있도록 지원합니다.
이 스킬에 리소스 점검 기능이 포함되어 있나요?
네, debug-buttercup 에는 파드 및 노드 수준에서 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.
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
복사





집
