sync-debug

Diagnose failing Notion worker syncs by inspecting run logs and cross-referencing sync code.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill sync-debug-duckshot-productions
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sync-debug
Source: https://github.com/Duckshot-Productions/ntn-worker/tree/main/.agents/skills/sync-debug
Command: npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill sync-debug-duckshot-productions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a Notion worker sync fails, stalls, or produces wrong results, finding the root cause requires digging through run statuses, logs, and source code. This Skill walks through that debugging process systematically so issues get identified and fixed faster. ## Core Features & Use Cases - Run and Log Inspection: Fetches sync status, recent runs, and full logs using the ntn CLI to pinpoint failing runs and error messages. - Failure Pattern Diagnosis: Maps common errors—authentication failures, rate limiting, timeouts, cursor/state bugs, schema mismatches, infinite loops, and empty results—to concrete fixes. - Fix and Verify Workflow: Guides applying code fixes, type-checking, resetting sync state when needed, and redeploying with preview verification. - Use Case: A sync that pulls issues from an external API suddenly stops updating its Notion database. Use this Skill to pull the latest run logs, discover a 401 auth error, re-authenticate OAuth, and resume the sync. ## Quick Start Ask the assistant to debug why your Notion worker sync is failing and suggest a fix.

Frequently Asked Questions about sync-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a failing Notion worker sync?▼

Run ntn workers sync status to check sync state, then ntn workers runs list to find failed runs, and ntn workers runs logs to read error output. Cross-reference the errors with your sync code in src/index.ts to identify the root cause.

How do I view logs for a specific sync run?▼

Use ntn workers runs list --plain, filter by sync key with grep, take the first run ID, and pass it to ntn workers runs logs. This prints the full log output including stack traces and console.log statements from your sync code.

Why does my sync fail with a 401 or 403 authentication error?▼

Authentication errors usually mean a missing or expired OAuth token or absent environment variables. Check tokens with ntn workers oauth token, verify variables with ntn workers env list, push missing vars with ntn workers env push, or re-authenticate via ntn workers oauth start.

Why does my sync run forever without completing?▼

An infinite loop happens when hasMore stays true because the cursor never advances. Verify that nextState changes between iterations and that your termination condition is actually reachable in the sync logic.

How do I fix state errors after changing my sync code?▼

If the persisted state shape no longer matches your updated code, reset it with ntn workers sync state reset <key>. This clears the old state and triggers a full re-backfill from scratch.

What causes schema mismatch errors in a Notion sync?▼

Schema mismatches occur when property keys in your changes don't match the schema.properties definition, or when builder types don't align. Ensure Builder.title() pairs with Schema.title() and Builder.richText() with Schema.richText().