/init:troubleshoot-pipeline-run [pipeline-name] [issue]from init
Troubleshoots dltHub pipeline runs when no source-specific guide exists. Checks workspace setup, profiles, config, and secrets for failed or pending loads.
Ships in init. 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.
Read when SKILL.md points to them.
Essential Reading
Troubleshooting that holds for any pipeline in a dltHub workspace, whatever the source. A guide made for the source or the runtime goes deeper, so use it when one is installed:
<source>/README.md (section 6)debug-pipeline (rest-api-pipeline)debug-sql-database-pipeline (sql-database-pipeline)debug-transformation (transformations)optimize-performance (performance)Parse $ARGUMENTS:
pipeline-name (optional): the dlt pipeline name. If omitted, infer it from the session or from dlt.pipeline(pipeline_name=...) in the script. If ambiguous, ask the user and stop.issue (optional, after --): what went wrong.dlt/.workspace exists in the project root. If it does not, stop: this skill does not troubleshoot plain dlt (OSS) projects. Tell the user and offer the in-place workspace setup (uvx dlthub-init@latest)..dlt/.workspace in the current working directory only, not in parent folders: uv run python pipelines/my_pipeline.py, not cd pipelines && python my_pipeline.py. Run from another folder, the workspace is not found: dlt.pipeline() runs without the profile, config, secrets and state of the workspace, and the dlthub CLI fails with invalid choice: 'local'.uv run dlthub ai status. If the dlt-workspace-mcp tools fail, this tells you why.uv run dlthub profile info. The profile decides which config, secrets and state the run uses (see Wrong destination, credentials or state in section 7).dlthub pipeline init and an entry in .dlt/.sources. Read its maintenance notes first (section 6)..dlt/config.toml and the pipeline script. You change the user's files while debugging, and at the end you restore only what YOU changed..dlt/config.toml (the default is WARNING):
[runtime]
log_level="INFO"
dlt.pipeline() call. pipeline.run() has no progress argument. With psutil installed it also logs CPU and memory:
pipeline = dlt.pipeline(..., progress="log")
requests helper or RESTClient, show the error response body (hidden by default):
[runtime]
http_show_error_body = true
A run goes through three steps, and the failing step tells you where to look:
| Step | What it does | Where the error usually comes from |
|---|---|---|
| extract | runs the source and resource code, writes items to files | your code or the source system: connection, auth, a bug in a resource or transform function |
| normalize | infers the schema, unnests nested data into child tables, writes load files | data that does not fit the schema, or a schema contract |
| load | creates tables and loads the files into the destination | destination credentials, permissions, type conversion on the destination, bad data in a load file |
Extract and normalize do not change the destination. A failure there is fixed in code or config, and the next run starts clean. A load failure may leave a partially loaded package (section 5).
Terminal or transient? A terminal error does not go away on retry: missing config, most HTTP 4xx, a missing table, bad data in a job file. A transient one may: a timeout or a dropped connection. Fix the cause of a terminal error before you retry.
Common exceptions:
| Exception | Meaning | Fix |
|---|---|---|
ConfigFieldMissingException | a config value or secret was not found. The message lists every key that was looked up | see Config or secret not found in section 7 |
PipelineStepFailed | a step failed. .step names it, and the cause is the inner exception at the bottom of the traceback | fix the cause. For a load failure, go to section 5 |
LoadClientJobTerminalRetry | a load job failed with a terminal error. The job is queued for retry and its package stays pending | read the job error (section 4), fix the cause, then recover (section 5) |
LoadClientJobRetry | a job failed transiently more than [load] raise_on_max_retries times (default 5). The package stays pending | check that the destination is reachable, then run again: the next run resumes the package |
a destination error when dlt adds a column: NOT NULL, NULL values, Adding columns with constraints not yet supported (DuckDB) | dlt adds a NOT NULL column to a table that already has data | see A load fails adding a NOT NULL column in section 7 |
DataValidationError | a schema contract rejected data. Its attributes name the table, the column and the contract mode | fix the data, or change the contract: https://dlthub.com/docs/general-usage/schema-contracts.md |
ModuleNotFoundError / MissingDependencyException | a source, destination or reader needs an extra. Destination packages are imported when run() connects to the destination, before extract | install what the message names, e.g. uv add "dlt[hub,<extra>]" or the driver package |
import error that reports a wrong dlthub plugin version | dlthub was installed on its own and does not match the dlt version | reinstall the extra pinned to your dlt version: uv add "dlt[hub]==<dlt version>" |
CannotRestorePipelineException from dlt.attach | the active profile has no state for this pipeline: another profile is active, the script ran from another folder, or the pipeline never ran | check the profile (Wrong destination, credentials or state in section 7) and run from the project root |
DestinationTerminalException containing database is locked (DuckDB) | another process holds the DuckDB file: the dashboard, another run, a notebook | close the other process, then run again |
Use the dlt-workspace-mcp tools first when they are available. These are the CLI equivalents. -v / -vv belong to dlthub itself, so put them right after it:
uv run dlthub local pipeline list # pipelines of the active profile
uv run dlthub -vv local pipeline trace <pipeline_name> # config/secret resolution, step timing and counts, the failure
uv run dlthub local pipeline trace <pipeline_name> metrics # files, rows and sizes per step (--steps extract normalize load)
uv run dlthub -v local pipeline info <pipeline_name> # dataset, destination, schemas, resources, pending packages and their load ids, state
uv run dlthub -v local pipeline load-package <pipeline_name> <load_id> # jobs by state, including jobs pending a retry; tables created
uv run dlthub local pipeline load-package <pipeline_name> <load_id> job <pattern> # full error history of matching jobs, across retries
uv run dlthub local pipeline load-package <pipeline_name> <load_id> row-counts # rows written per table for this load id
uv run dlthub local pipeline failed-jobs <pipeline_name> # failed jobs of completed packages only
Without <load_id>, load-package shows the most recent package.
A failed load job stays pending. Since dlt 1.30, a job that fails on load is queued for retry and its package stays pending, so failed-jobs does not list it. Read it with load-package <pipeline_name> <load_id> and its job action. The most likely cause of a failed job is the data in its file.
The trace shows which config keys were looked up and where each value came from. Read it when a value resolves to the wrong thing, not only when it is missing. The dashboard (uv run dlthub local pipeline show <pipeline_name>) shows the same under Resolved Config Values.
A pipeline's working directory is .dlt/state/<profile>/pipelines/<pipeline_name>/. Completed packages are under load/loaded/<load_id>/, with job files in completed_jobs/ and failed_jobs/ ([load] delete_completed_jobs=true removes them). Each retry writes its error to the package's .exceptions folder, and the first line says retry: terminal or retry: transient. Gzipped files read with zcat <file>.gz. Use them to check what dlt actually sent to the destination.
Escalate in this order and do not skip a step:
run() first normalizes and loads the pending packages, and then exits without extracting new data. Jobs that completed are never run again, so a retry is safe even for a partially loaded package. Run once more to extract new data. To load the pending packages without running the script: dlt.attach("<pipeline_name>").load().uv run dlthub local pipeline load-package <pipeline_name> <load_id> fail-job <job_id>
A job that a crash interrupted cannot be failed this way: run again, or abort.uv run dlthub local pipeline abort-packages <pipeline_name>
It marks the oldest pending package as aborted and moves its unfinished jobs to failed_jobs. It deletes the other pending packages, extracted ones included. Local state and schemas go back to where they were before the package, so incremental cursors rewind. Data the aborted package already loaded stays in the destination (see Partially loaded package below). drop-pending-packages is a deprecated alias of this command.uv run dlthub local pipeline sync <pipeline_name>
sync deletes the local working directory (pending packages, unsynced state, schemas) and restores it from the destination. The destination is left as it is. Do not use it to clear pending packages: abort does that.uv run dlthub --non-interactive -y local pipeline drop <pipeline_name> <resource>
drop deletes the destination tables and resets their state, which forces a full reload of those resources. --state-only resets the state and keeps the tables.re: prefix. Prefer named resources. Use --drop-all only after the user confirms it explicitly.drop asks [y/N], and -y answers yes for you. Before you pass it, confirm the pipeline name, destination, dataset and the resources to drop with the user.PipelineStepFailed warns when a package was partially loaded. To check, run load-package <pipeline_name> <load_id> row-counts. If the destination has rows for the load_id but the package is not in _dlt_loads, the load did not finish.
merge and replace tables: do not delete rows by hand. Abort and run again.append tables: the rows of the failed load can be deleted by _dlt_load_id, nested tables first. The procedure is in running.md. Ask the user before you delete anything from the destination.A verified source lives in its own <source>/ folder, which dlthub pipeline init created. <source>/version.py holds the installed version.
Before you change the pipeline, read the source's docs page and follow it like a skill: setup, credentials, resources and arguments. <source>/README.md links it in its first lines; add .md to the URL for the markdown version. Without the link, see verified-sources.md.
Then read <source>/README.md before the code. It answers two questions:
python / pyarrow).https://raw.githubusercontent.com/dlt-hub/verified-sources/master/sources/<source>/README.md. Entries above the installed version are fixes the copy does not have. If one matches, propose an update instead of patching the code.Update only with the user's OK:
uv run dlthub --non-interactive pipeline init <source> <destination>.--non-interactive skips the update. Ask the user to run the command in their own terminal instead.More detail (what init copies, copies without version.py, the dlt version check, the update choices): verified-sources.md.
secrets.toml. Put the value at one of the listed keys → setup-secrets. Never read secrets.toml.config.toml. A secret stored there is not found.SOURCES__... or DESTINATION__... variable wins over a value you edit. Check variable names only, never print their values.sources.<module>.<function>.<key>, then sources.<module>.<key>, then sources.<key>. Renaming or moving the module changes the section.run() loaded packages left by an earlier run and exited without extracting, and the log warns about it. Run again..add_limit(N) counts yields, which for most sources are pages, not rows. Use .add_limit(N, count_rows=True) to count rows.discard_row or discard_value drops data without an error.dev_mode=True, every run writes to a new dataset with a datetime suffix.dataset_name defaults to <pipeline_name>_dataset, and pipeline_name defaults to the script's file name. Renaming the script starts a new pipeline, with new state and a new dataset.@dlt.source function runs when the source is created, outside error handling and metrics. Fetch data in resources.@dlt.resource(columns={"amount": {"data_type": "decimal", "nullable": True}})
dev_mode=Truerefresh="drop_resources" on dlt.pipeline() or run()float for money or other precision-sensitive values: use decimal.Most destinations cannot add a NOT NULL column to a table that already has rows, because the existing rows have no value for it. DuckDB fails with Adding columns with constraints not yet supported. dlt adds such columns in these cases:
| Column | Added when |
|---|---|
_dlt_load_id, _dlt_id | a resource that loaded Arrow tables or DataFrames now yields Python objects (see the next section), or dlt loads into a table it did not create |
_dlt_parent_id | dlt loads into a nested table it did not create |
_dlt_root_id | a resource with nested tables switches to merge, or gets root_key=True, after its nested tables were created |
your column with nullable: False | the column is new in a table that already has rows |
Fix it in one of these ways, and confirm with the user before you change destination tables:
refresh="drop_resources". This deletes their data and resets their schema, so dlt creates the columns on empty tables.merge resource, also drop its tables in the staging dataset (<dataset>_staging), because they keep the rows of the last load._dlt_root_id only: if the nested tables are at most one level deep, disable root key propagation with root_key=False on the source.Refs:
_dlt_root_id: https://dlthub.com/docs/general-usage/merge-loading.md (section "Add the root key to existing tables")This covers changing a live resource from yielding Python objects (dicts) to Arrow tables or DataFrames, or back. Changing a source's backend argument does the same, e.g. python ↔ pyarrow in verified sources, or sqlalchemy ↔ pyarrow / pandas / connectorx in sql_database. The two formats create different tables:
| Python objects | Arrow tables, DataFrames | |
|---|---|---|
| dlt columns | _dlt_load_id and _dlt_id, both NOT NULL | none by default |
| nested data | lists become child tables, dicts become flattened columns | per the Arrow types (in verified sources, see Maintenance & Troubleshooting) |
| column types | inferred from the values | taken from the Arrow schema |
Because dlt never alters existing columns, a switch on a pipeline that already loaded data leaves tables made for the other format:
_dlt_load_id and _dlt_id as NOT NULL columns to tables that have rows, and the load fails (see the previous section). Nested data that went into columns now goes to child tables, so the old columns stop getting data._dlt_load_id and _dlt_id columns are NOT NULL, but Arrow rows bring no values for them. Enable both before you switch:
[normalize.parquet_normalizer]
add_dlt_load_id = true
add_dlt_id = true
add_dlt_load_id costs little. add_dlt_id rewrites every file in the normalize step. Without _dlt_load_id, rows cannot be traced to a load: neither row-counts nor the partial-load cleanup in section 5 can find them.The cleanest switch reloads the resource (refresh="drop_resources" or drop it, section 5). Confirm with the user first, because it reloads all the data. To keep the data, add the dlt columns yourself (previous section) and compare the new columns with the old ones before you run the full load.
Ref: https://dlthub.com/docs/dlt-ecosystem/verified-sources/arrow-pandas.md (section "Add _dlt_load_id and _dlt_id to your tables")
<column>__v_<type>, e.g. id__v_text: a value could not be coerced to the column's type, so dlt stored it in a variant column. Fix the type in the resource or with a column hint. To reject such data instead, use the contract {"data_type": "freeze"}.<table>__<field>: dlt unnests nested lists into child tables and flattens nested dicts into <field>__<subfield> columns. To change this:
max_table_nesting on the resource (0 keeps all nested data as JSON). A value set on the source is ignored when the resource is accessed as source.resources[...], so set it on the resource;{"data_type": "json"}.snake_case.
primary_key, incremental cursors, add_map and add_filter use the source names.merge without primary_key or merge_key falls back to append.merge with a primary_key.upsert expects a unique primary_key: with duplicate keys the result is not deterministic. delete-insert deduplicates by primary key but picks an arbitrary row, unless you set the dedup_sort column hint.append table that has child tables to merge fails: dlt adds a NOT NULL _dlt_root_id column. See A load fails adding a NOT NULL column above.Check the stored cursor with uv run dlthub -v local pipeline info <pipeline_name>. Look for last_value in the resource state and verify it moves between runs. Also look in the logs for Bind incremental on <resource_name>, which confirms the incremental was bound. Then check:
pipeline_name, destination and dataset_name match the earlier runs, and the profile is the same.dev_mode is off and no refresh is set.write_disposition="replace" resets the resource state on every run. The cursor then restarts from initial_value.end_value makes the run a backfill that does not update the stored cursor.The workspace reads config and state per profile:
config.toml and secrets.toml apply to every profile. .dlt/<profile>.config.toml and .dlt/<profile>.secrets.toml override them for one profile..dlt/state/<profile>/, and its own local data, .dlt/data/<profile>/. A pipeline that ran under dev is not listed under prod.dev unless a profile is pinned. A pin (.dlt/profile-name) also applies to plain python runs.dev, tests, prod and access. Pinning a misspelled name does not fail: the run just finds no config for it.To check:
uv run dlthub profile info # active profile and whether it is pinned
uv run dlthub -v local info # every file location the active profile reads settings from
uv run dlthub local profile use <profile> # pin another profile
.add_limit(N) to the resource.[extract]
next_item_mode = "fifo"
requests helper or RESTClient retry 429, 5xx and timeouts with exponential backoff, by default 5 attempts with waits of up to 300 s, and they honor Retry-After.[normalize] workers above 1 on Linux: set [normalize] start_method="spawn".optimize-performance.Revert the debugging settings YOU introduced, and keep anything the user had before:
.dlt/config.toml: restore log_level. Remove http_show_error_body and [extract] next_item_mode if you added them.progress="log", .add_limit(N) and refresh= if you added them.dev_mode=True: remove it before the pipeline loads real data. It writes every run to a new dataset.setup-secrets.dlthub-router to install it.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dlt-hub/dlthub-ai-harness --plugin init5 skills in this plugin
/create-background-agentWrite a dltHub background agent: an AGENT.md that runs unattended on the platform, on a schedule, after a job fails, or when someone starts it from the web UI. Use when the user wants work to happen on its own after an event ('whenever a job fails, diagnose it for me', 'every Monday summarise what broke'), when they ask how to write, declare or deploy an AGENT.md, how to pick its access, tools, inputs or output, how to set run.agent, or how to ship an agent in a toolkit. Do NOT use for a host subagent in .claude/agents/, for scheduling a pipeline or a plain job (deploy-workspace), for diagnosing one failure right now (debug-deployment), or for setting AGENT__MODEL and the other AGENT__ variables, which belong to any agent job including the shipped job-inspector./dlthub-routerThe entry point for building anything with dlthub: route the user to the right workflow toolkit and install it on demand. MUST use when the user asks 'what can you do', 'what can I build', 'what are toolkits', 'how do I build a pipeline', 'I want to pull data from a REST API', 'ingest from a SQL database', 'ingest CSVs from S3 into a warehouse', 'make reports / dashboards', 'transform / model my data', 'add data quality checks', 'how do I deploy / schedule a pipeline', 'I'm new to dlthub', 'where do I start', 'my deployed job failed', or seems unsure what to do next after setup. Also use when the user names a data-engineering goal and no matching toolkit is installed yet. Do NOT use when the matching toolkit is already installed: go straight to its entry skill. Do NOT use when a specific task is in progress (debugging a pipeline, validating data, adding endpoints) and its toolkit is installed. Do NOT use when the user wants a guided end-to-end demo: use **quick-start**./improve-skillsImprove existing skills based on the current session. Use at the end of a session (or when the user asks) to capture new debugging patterns, data issues, data validation tracks, querying techniques, doc references, or workflow improvements learned during the session. Keeps skills lean and personalized./setup-secretsSafely manage dlthub secrets in *.secrets.toml. Use when the user directly asks to set up, configure, or inspect credentials (API keys, database passwords, tokens). Also use when writing Python code that needs to read secrets via dlt.secrets without exposing values. Do NOT use for pipeline creation, source discovery, or debugging pipeline execution — those skills call setup-secrets when they need credentials configured.Other plugins' skills for the same job