stacktrace-log-triage

작성자: kotlin

스택 트레이스, 시작 로그, 런타임 로그 및 관련 메트릭 이상 현상에서 Kotlin + Spring 실패를 진단한 후, 래퍼 예외와 근본 원인을 분리합니다…

npx skills add https://github.com/kotlin/kotlin-backend-agent-skills --skill stacktrace-log-triage

Stacktrace Log Triage

Source mapping: Tier 1 critical skill derived from Kotlin_Spring_Developer_Pipeline.md (SK-15).

Mission

Turn noisy failure evidence into a ranked diagnosis with explicit confidence. Always distinguish symptom, proximate cause, and true root cause.

Gather Evidence First

  • Read the full stack trace, not only the top frame.
  • Read the surrounding log lines before and after the first failure.
  • Capture timestamps, correlation ids, request ids, thread names, and active profiles when available.
  • Read recent relevant code or config changes if they are available.
  • Reuse repository constraints from project-context-ingestion when possible.

Triage Workflow

  1. Find the earliest meaningful failure signal.
  2. Walk the Caused by: chain until it stops getting more specific.
  3. Classify the incident:
    • DI and context startup
    • configuration binding
    • serialization or validation
    • SQL or migration
    • HTTP or timeout
    • security
    • concurrency or locking
    • classpath or version mismatch
  4. Separate what failed from why it failed.
  5. Rank hypotheses when evidence is incomplete.
  6. Propose a quick mitigation and a proper fix separately.

Diagnostic Rules

  • Treat BeanCreationException, InvocationTargetException, and similar wrappers as transport, not diagnosis.
  • Treat the first user-code frame after framework wrappers as high-signal evidence.
  • Use log chronology, not stack depth alone.
  • If the logs are truncated, say so and lower confidence.
  • Prefer an explanation grounded in the observed code path or configuration over pattern-matching from memory.

Advanced Signal Patterns

  • Check suppressed exceptions, root-cause logging one or two lines above the stack trace, and companion failures on adjacent threads. The most useful clue is often not in the main stack at all.
  • Distinguish hard failures from saturation patterns: connection pool exhaustion, thread pool starvation, event-loop blocking, retry storms, and deadlock retries often show up as secondary symptoms first.
  • For SQL failures, inspect vendor codes and SQL state when available. They are often more actionable than the wrapper exception type.
  • For startup failures after version or deploy changes, compare classpath and configuration drift before assuming a code bug.
  • For intermittent failures, weigh time correlation and concurrency context heavily. A race rarely leaves a clean single-thread narrative.
  • For OOM or GC-related incidents, plain stack traces are weak evidence. Thread dumps, heap symptoms, and allocation context matter more.
  • If metrics exist, correlate the first error spike with latency, pool saturation, or downstream dependency degradation rather than treating logs in isolation.
  • If the symptom appears in reactive or coroutine code, verify whether context propagation broke logging correlation before dismissing missing IDs or misleading thread names.

Expert Heuristics

  • The first fix after triage should reduce uncertainty as well as reduce pain. Prefer mitigations that also sharpen diagnosis.
  • If several candidate causes fit, rank them by evidence, blast radius, and reversibility of the proposed mitigation.
  • If the trace points to a framework wrapper, move outward to code and config that changed recently, then inward again through the causal chain.
  • Always state what evidence would falsify the leading hypothesis.

Output Contract

Return these sections:

  • Root cause: confirmed or most likely cause in plain language.
  • Confidence: confirmed, high, medium, or low.
  • Evidence: the log line, exception, config fact, or code path supporting the diagnosis.
  • Hotfix: the safest immediate containment or unblocking step.
  • Long-term fix: the proper code or configuration correction.
  • Reproduction and verification: how to reproduce, test, and monitor the fix.

Safety Rules

  • Label hypotheses as hypotheses.
  • Do not recommend risky schema changes, version upgrades, or broad refactors as a hotfix unless the incident truly leaves no safer option.
  • Do not claim certainty when the logs are incomplete.
  • Do not ignore alerting or monitoring implications after the fix.

Kotlin-Specific Checks

  • Watch for platform-type NullPointerException.
  • Watch for coroutine stack traces that obscure the original call path.
  • Watch for missing Kotlin compiler plugins causing runtime behavior gaps.
  • Watch for Jackson plus Kotlin constructor issues that surface as generic deserialization errors.

Quality Bar

A good run of this skill gives the user a path from failure evidence to safe remediation. A bad run repeats the top exception, ignores the Caused by: chain, or offers a dangerous hotfix without explaining the risk.

kotlin의 다른 스킬

ci-cd-containerization-advisor
kotlin
재현 가능한 빌드, 이미지 및 배포 파이프라인을 설계합니다. Kotlin 및 Spring 애플리케이션을 대상으로 하며, CI 검증, 계층형 컨테이너, 롤아웃 안전성 등을 포함합니다.
official
configuration-properties-profiles-kotlin-safe
kotlin
Design and diagnose Spring configuration, profiles, and `@ConfigurationProperties` binding for Kotlin applications. Use when property binding fails,…
official
dependency-conflict-resolver
kotlin
Diagnose and resolve Gradle and Spring classpath conflicts, version drift, and binary incompatibilities in Kotlin applications. Use when `NoSuchMethodError`,…
official
domain-decomposition-api-design-advisor
kotlin
구현을 시작하기 전에 비즈니스 범위를 경계 컨텍스트, 모듈 또는 서비스 경계, 워크플로우, API 계약으로 분해합니다. 새로운 것을 설계할 때 사용하세요.
official
error-model-validation-architect
kotlin
Kotlin과 Spring 서비스를 위한 일관된 API 검증 및 오류 처리 동작을 설계하고 구현합니다. 오류 페이로드를 정의하거나 프레임워크를 매핑할 때 사용합니다.
official
gradle-kotlin-dsl-doctor
kotlin
Generate, debug, and repair Kotlin + Spring Gradle builds with minimal, compatible changes. Use when `build.gradle.kts` or `settings.gradle.kts` is failing,…
official
integration-resilience-engineer
kotlin
탄력적인 HTTP, 메시징, 예약 통합을 Kotlin 및 Spring 서비스용으로 설계하며 명시적인 타임아웃 예산, 재시도, 멱등성, 서킷 브레이커를 포함합니다.
official
jackson-kotlin-serialization-specialist
kotlin
Kotlin과 Jackson을 사용하는 Spring 애플리케이션에서 JSON 직렬화 및 역직렬화 동작을 진단하고 설계합니다. DTO 역직렬화 실패 시, 기본값…
official