---
name: fix-sentry-issues
description: Use Sentry MCP to discover, triage, and fix production issues with root-cause analysis. Use when asked to fix Sentry issues, triage production errors, investigate error spikes, or clean up Sentry noise. Requires Sentry MCP server. Triggers on "fix sentry", "triage errors", "production bugs", "sentry issues".
title: fix-sentry-issues
canonical_url: https://skilld.dev/gh/brianlovin/agent-config/fix-sentry-issues
last_updated: 2026-09-29T07:50:56.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install brianlovin/agent-config/fix-sentry-issues`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/fix-sentry-issues`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/brianlovin/agent-config/fix-sentry-issues) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/fix-sentry-issues`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/fix-sentry-issues --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/fix-sentry-issues --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Fix Sentry Issues

## Philosophy

**The Sentry error is not the problem. It's a signal.**

Your goal is not to close the Sentry issue. Your goal is to discover the root cause, understand what's wrong with the application, and fix the underlying defect. Closing the Sentry issue is a side effect of doing that correctly.

Ask **"Why does this fail?"** — not **"How do I make Sentry quiet?"** Never treat log level changes as fixes. A fallback path means degraded user experience; trace why the primary path fails and fix it upstream.

## Anti-patterns (do not do these)

- **Batch-classifying as "expected" without investigation.** Seeing a fallback does NOT mean you understand the failure. Trace the full input path.
- **Treating "has a fallback" as "not a problem."** Why does the primary path fail? Can we prevent it upstream?
- **Combining multiple issues into one PR.** Each has its own root cause. Fix individually (except when investigation proves identical cause).
- **Throwing away error details.** Never remove `error` from `catch (error)` or strip status codes. That data is how you understand failures.
- **Deciding the fix during triage.** Classify as "Investigate" or "Ignore" only. You don't know the fix until investigation is complete.

**Log level downgrade is valid ONLY for genuinely expected states** (e.g., optional column missing, resource deleted) — NOT for failures with fallbacks.

## Phase 1: Discover & Triage

Use Sentry MCP (`ToolSearch` first to load tools): `find_organizations` → `find_projects` → `search_issues` with `naturalLanguageQuery: "all unresolved issues sorted by events"`.

Build a triage table. Action = **Investigate** or **Ignore** only:

| ID | Title | Events | Action | Reason |
|----|-------|--------|--------|--------|
| PROJ-A | Error in save | 14 | Investigate | User-facing save failure |
| PROJ-B | GM_register... | 3 | Ignore | Greasemonkey extension |

**Investigate:** multiple events, degraded user experience, high-volume warnings, recurring on every run.
**Ignore:** browser extension code, `ChunkLoadError` (self-resolving), single-event transients, already fixed.

Apply: `mcp__sentry__update_issue(..., status: "ignored")` or `status: "resolved"` for already-fixed.

## Phase 2: Investigate (one issue at a time)

Work through these steps **in order**. Do not skip or batch issues.

1. **Pull event-level data** — Issue summaries hide details. Use `get_issue_details` and `search_issue_events` with `naturalLanguageQuery: "all events with extra data"`. Extract: URLs, params, stack traces, status codes, timestamps.

2. **Cross-reference Axiom** — Events have `traceId`. `axiom query "['shiori-events'] | where traceId == '<traceId>'" -f json` for surrounding context (authMethod, client_version, request metadata).

3. **Read the failing code path** — Follow the stack trace. Read every file. Understand before proposing changes.

4. **Trace the input path upstream** *(most often skipped, most important)* — What data reaches the failing function? Should it have reached this path at all? Is there a missing filter? Is the input wrong (binary URL, redirect, bad format)? Can we prevent bad inputs upstream?

5. **Reproduce** — Use actual failing inputs from Sentry. Call the function with exact data. `fetch()` the URLs that timed out. Verify your understanding.

6. **Identify root cause** — Why does this input fail? Why does it reach this path? What's the right fix? (e.g., "Filter binary URLs before Firecrawl" — not "suppress the log")

| Pattern | Real Fix |
|---------|----------|
| External API fails on certain URLs | Filter/validate inputs before sending |
| Timeout | Investigate what's slow; adjust timeout or input size |
| DB "invalid json" | Sanitize before insert |
| Stale reference on cron | Detect staleness, auto-clean |

## Phase 3: Fix

One branch per issue. `git checkout main && git pull && git checkout -b fix/<descriptive-name>`

- **Tests first** — Use data from actual Sentry events. Test fails before fix, passes after.
- **Implement** — Fix the root cause, not the symptom. If the fix is primarily a log level change, STOP: did you investigate why it fails, or just suppress?
- **Verify** — Tests pass, lint passes, fix handles actual failing inputs.
- **PR** — Include **Root cause** (upstream reason) and **Fix** (what changed and why it prevents the failure). Resolve in Sentry only after merge.
