/drt:drt-debugfrom drt
Debug and fix failing drt syncs by running environment checks, reproducing errors with verbosity flags, and diagnosing auth errors, rate limits, and template issues.
Ships in drt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Debug a failing drt sync.
Start with the environment-level triage:
drt doctor # checks env vars, profile file, python/extras, common gotchas (v0.7+)
This catches the bulk of "it doesn't even start" cases before you read code.
If drt doctor is clean, ask the user to share (or read from context):
drt run or drt statussyncs/<name>.yml)drt_project.yml if relevantReproduce with more signal — pick the right verbosity:
drt run --select <name> --verbose — row-level error detailsdrt run --select <name> --dry-run — config parses, no data sentdrt run --select <name> --dry-run --diff — record-level preview for queryable destinations. It distinguishes omitted fields from explicit nulls: partial updates preserve them, replace shows <default>, and append-only writes show INSERT (#1138)drt run --output json / drt status --output json — structured output for CI / scripting (v0.7+)drt run --log-format json — JSON Lines logs to stderr (separate from --output)drt run --select <name> --limit 10 — really load ≤10 rows (#774) to reproduce with a small, inspectable send; cursor watermarks and snapshot-diff baselines do not advance (refused for mode: mirror / replace)drt run --failed — re-run only the syncs whose last status wasn't success (#773) — the tight loop while fixing one red sync in a larger projectdrt run --fail-fast — stop after the first failure (#775) instead of running the whole set when the cause is systemicDiagnose the root cause using the patterns below.
Suggest a concrete fix with the corrected YAML or command.
token_env or value_env env var not set, or token has wrong permissions.echo $MY_TOKEN, verify token scopes. For HubSpot, confirm Private App has CRM write scope. For GitHub, confirm actions: write.*_env value beginning aws-sm://, gcp-sm://, or vault:// is a secret-provider URI, not an env-var name. Install its matching extra, then use drt doctor to distinguish a missing provider dependency from an IAM/path error.drt validate flags hardcoded secret detected, the YAML literally contains a token instead of token_env. Move it to an env var and reference it.sync.rate_limit.requests_per_second. HubSpot max: 9 req/s. GitHub Actions: 5 req/s.sync.dlq.enabled: true + on_error: skip, v0.7.9+) so per-record failures persist to .drt/dlq/<sync>.jsonl instead of being dropped, then drt retry <sync> re-sends just those once the limit clears. drt status shows the queue depth.destination.rate_limit_key to the real stable quota identity; this public YAML field overrides the host-derived key (rate_limit_key_override is internal, not YAML).url with curl -X POST <url> manually. drt run --dry-run confirms config parses correctly without sending traffic.390114 token expiry, a Databricks warehouse cold start, a Postgres connection reset, a 5xx on a REST page. No config needed. ⚠️ Retries cover connection + query execution only; a failure after the first row was yielded is not retried (those rows are already loaded and can't be un-sent), so a mid-read drop still fails the sync. Auth failures are never retried — repeated attempts can trip an account lockout, so a persistent connect error is more likely a credential/permission problem than a flaky network.{{ row.field_name }} references a column that doesn't exist in the source.drt run --dry-run previews rows; confirm column names match the template. For datetime / Decimal / UUID columns flowing into a REST API body_template, use the tojson_safe filter (v0.7.6+) rather than CAST(... AS STRING) in SQL.ErrorFormatter now attaches a stage tag to every error (extract / load / finalize / validate). If the surfaced error mentions a stage you didn't expect (e.g. a finalize failure on a SQL destination's mirror mode), the bug is in that stage's code path — not in the load loop.finalize failures on sync.mode: mirror (v0.7.7+), check upsert_key is set and the source key cardinality is small enough to hold in memory.mode: incremental has no saved cursor yet, so the first run syncs all rows.drt status after the first run — last_cursor_value should be set. To probe a backfill boundary, use drt run --cursor-value '<value>' --select <name>.incremental_strategy: diff deliberately reads the full model into a warehouse snapshot, then emits only added/changed rows. It requires mode: upsert|mirror, a destination upsert_key, no cursor_field, and a Postgres/Snowflake/Databricks/BigQuery source profile with writable managed_schema. A first run has no prior baseline, so every row is added. Same-sync overlapping runs are unsupported. --limit does not promote the baseline.drt state show <name> — shows the stored watermark, last status and row count. Works for remote watermark backends (GCS / BigQuery) too, which .drt/*.json inspection does not.drt run --select <name> --full-refresh re-reads everything and persists a fresh watermark (v0.8.4+). Prefer this over hand-editing .drt/watermarks.json, which does nothing when a remote backend is configured.--cursor-value is a probe — it overrides one run and leaves stored state untouched. --full-refresh is the reset.--full-refresh does not reset tracked-mirror state. If mirror deletes look wrong, that is drt state reset <name> --tracked-mirror — read its warning first, since re-baselining makes rows written by other systems into deletion candidates.on_error: fail stopping earlyon_error: skip to continue past failures and see the full error count via drt run --verbose or drt status.on_error: skip with sync.dlq.enabled: true (v0.7.9+) so the skipped records land in .drt/dlq/<sync>.jsonl; drt retry <sync> replays just them after you fix the root cause. To re-run whole syncs that failed (not individual records), use drt run --failed (#773). See docs/guides/dead-letter-queue.md.~/.drt/profiles.yml missing or profile name mismatch.cat ~/.drt/profiles.yml, verify the profile name matches drt_project.yml. Override per-run with drt run --profile <name> or the DRT_PROFILE env var.schema.table)schema.table as a single identifier — e.g. ClickHouse Code: 62 on db.table, Postgres syntax errors on marketing.events._quote_ident #498), v0.7.4 (MySQL #514), v0.7.8 (ClickHouse #610). Upgrade to the latest patch release and the qualified form parses correctly.sync.mode: mirror forces the MERGE write path regardless of config.mode (v0.7.7+).replace semantics for Snowflake mirror — Snowflake's mirror doesn't have a swap path.incremental_strategy: diff or state.backend: warehouse needs drt-owned tables under the connection profile's managed_schema (default _drt), but the role cannot create/probe/write them.managed_schema is on the Postgres/Snowflake/Databricks/BigQuery profile, not under sync.diff or project state.column mismatchsync.batch_size so every sparse field appears in the first batch. Missing values for already-known columns are written as empty cells.alerts.on_failure channels — Slack / webhook notifications fire when the run hits a hard failure.Change guards tripped (v1.2)sync.guards (max_deletes / max_delete_pct, plus max_creates / max_updates_pct in drt plan / drt apply) refused a run that would change more rows than allowed. This is the guard working, not a bug. For a plain trip nothing was deleted or swapped; the two variants below say otherwise, so read the full message.mirror.scope). If the change is genuinely intended, review it with drt plan, then drt apply --force-guards (a human decision; recorded in the run results), or raise the limit in the YAML. Never add --force-guards to an automated job.mirror.strategy: diff reports no denominator, so max_delete_pct fails closed — use max_deletes there....but rollback failed; the destination outcome is uncertain (Postgres/MySQL/Snowflake): the guard tripped but the rollback of the refused DELETE failed — check the target table's row count before re-running....AFTER the DELETE ran; it is already committed (Databricks/BigQuery): these cannot roll a DELETE back. The pre-count passed but the statement removed more than counted (a concurrent writer) or its row count was unreadable. Recover with RESTORE TABLE ... TO VERSION AS OF (Delta) or table time travel (BigQuery).drt apply refuses a plan (v1.2)update_only / create_only are refused).drt plan again and review the new change set. See docs/guides/plan.md and the refusal table in the drt-review-sync skill.write_policy: fill_empty rejected at validate (v1.2)fill_empty needs an upsert write path — it is rejected with destination.mode: insert and with sync.mode: replace (a rebuilt table has no existing value to keep), and create_only has nothing to fill.mode: merge/upsert with an upsert_key; see docs/guides/write-policy.md.drt test --select <name> — runs the post-sync validation tests (freshness / unique / accepted_values) declared in the sync YAML; use this when "the sync says success but the data looks wrong".drt_run_test MCP tool (v0.7.5+) — same as drt test but callable from Claude/Cursor without leaving the chat.target/drt/run_results.json — durable per-invocation results even in text output mode. Raw exception text is intentionally omitted; use console/--output json for the full error. A preflight failure before sync selection does not produce the artifact, and --target-path relocates it.observability.otel.endpoint in drt_project.yml and pip install drt-core[otel] to capture spans. Phase 3 engine spans (drt.sync.run / drt.sync.extract / drt.sync.load) shipped v0.7.10 (pip install drt-core[otel]).drt ships anonymous opt-in telemetry (PostHog Cloud EU, off by default, v0.7.2+). If a user is debugging in an offline / regulated environment and wants to be sure no analytics fire, set DO_NOT_TRACK=1 or telemetry.enabled: false in ~/.drt/config.yml. drt also honours the DO_NOT_TRACK standard env var with no config.
docs/llm/CONTEXT.md for architecture and key concepts.docs/llm/API_REFERENCE.md for all config fields.docs/connectors/ for per-connector details (auth, sync modes, gotchas).Column contract violation: ...: the model's output no longer matches the sync's columns: (missing, extra or retyped column). Fix the model or the declaration; with contract.source: dbt the manifest may be stale (dbt build), or the dbt model has no enforced contract.on_schema_change / managed-table errors: with on_schema_change: fail a new source column is refused before any write; use append_new_columns to add it (nullable), or add the column yourself. A missing CREATE/ALTER privilege is named in the message. drt never drops or retypes a column.drt status --check: exit 1 means a sync is stale (older than alerts.on_stale.max_age) or has never run; read the per-sync lines before re-running anything. An unreadable state or history store is reported, not hidden.What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/drt-create-syncGenerate a drt sync YAML configuration file. Use this skill whenever a user wants to create a new drt sync, connect a data warehouse table to an external service, or set up a Reverse ETL pipeline with drt.
/drt-initGuide a user through initializing a new drt project. Use this skill when a user is setting up drt for the first time, asks how to get started with drt, or needs help configuring their data warehouse connection.
/drt-migrateHelp migrate from Census, Hightouch, Polytomic, or custom scripts to drt. Use this skill when a user wants to replace their existing Reverse ETL tool with drt, or asks how to replicate a sync they had in another tool.
npx claudepluginhub drt-hub/drt --plugin drtOther plugins' skills for the same job