> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshoot Deepline | Agent guide

> Diagnose installation, authorization, input, execution, usage, and destination failures without blind retries.

[Human guide: task steps and agent prompt →](https://deepline.com/docs/human/troubleshooting.md)

Identify the failed boundary before repeating a request. Preserve the command,
run or execution identity, and returned error. A timeout is not proof of no work.

Start at the section that matches the failure:

| Symptom | Start with |
| - | - |
| CLI missing or setup incomplete | [Installation](#1-check-installation) |
| Wrong org or sign-in failure | [Effective org](#2-check-the-effective-org) |
| Unknown tool, invalid fields, or CSV errors | [Discovery and input](#3-separate-discovery-from-input-errors) |
| Interrupted, failed, or unexpected run | [Existing work](#4-inspect-existing-work) |
| Missing usage, credit refusal, or cap refusal | [Usage](#5-reconcile-usage-separately) |
| Provider authorization or uncertain write | [Connections and external writes](#6-diagnose-connections-and-external-writes) |
| SQL access or query failure | [Database access](#7-diagnose-database-access) |

Inspect existing evidence before retrying. Installation checks are only needed
when the CLI or setup is failing.

## 1. Check installation

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
command -v deepline
deepline --version
deepline doctor --json
```

Run these in the actual agent environment. A CLI installed on your laptop may
not exist in a remote sandbox.
Follow [the installation guide](https://code.deepline.com/INSTALL.md) when setup
is incomplete. Let an existing setup or authorization flow finish first.
If installation is missing, paste this into your agent:

```text theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
Install and set up the official Deepline CLI globally from npm (package: deepline) by following https://code.deepline.com/INSTALL.md. After setup, continue my existing task if I gave one. Otherwise, present the guide's four starter choices verbatim, with each of the first three requests starting with /deepline-gtm.
```

## 2. Check the effective org

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline auth status --json
deepline org status --json
```

Compare the org and credential source with the current folder.
Use [folder bindings](https://deepline.com/docs/sdk-v2/multi-org.md) to correct a mismatch.

CLI authorization does not export `DEEPLINE_API_KEY` into your shell.
A raw HTTP caller needs its own supported server-side credential setup.
Do not print keys into logs to diagnose this difference.

## 3. Separate discovery from input errors

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline search "your intended outcome" --json
```

Describe the returned identifier before execution. Check required fields, input
types, column mappings, and access mode. Do not invent an ID from a provider name.

For custom source, use `deepline plays check <file>`.
For CSV failures, use [file validation](https://deepline.com/docs/guides/validate-incoming-csv-files.md).
Do not build a retry sample by splitting physical lines with `head`.

## 4. Inspect existing work

For a Play, inspect the saved run:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline runs get <run-id> --full --json
deepline runs logs <run-id> --json
```

Use [Run logs and events](https://deepline.com/docs/sdk-v2/run-events.md) for filters and retained payloads.
For a direct call, use [execution recovery](https://deepline.com/docs/sdk-v2/tool-execution-recovery.md).

A completed run can return a legitimate no-result. A failed provider request
has a different meaning. Preserve that distinction before changing sources.

### Separate runtime status from the business result

| Evidence | What it establishes |
| - | - |
| Run status and progress | Whether execution is active or terminal; which work progressed |
| Logs and retained tool results | Recorded context and available source-response evidence |
| Outputs and dataset rows | What the handler returned and the outcome for each retained row |
| Destination read-back | The operating state observed after an external action |
| Scoped usage | The recorded charge under the applicable billing contract |

A completed handler can return no match. A failed run can retain useful
intermediate work. The compact status response does not embed all dataset rows
or full saved tool results; use their retrieval paths in
[Call Plays](https://deepline.com/docs/sdk-v2/calling-plays.md#inspect-and-export-an-existing-run) and
[Run logs and events](https://deepline.com/docs/sdk-v2/run-events.md).

If research completed but a CRM task request timed out, inspect the accepted
research, write attempt, and destination independently. Preserve the version
and decision evidence; reconcile whether the task exists before repeating it.
Unavailable or expired response evidence remains unknown. Retained counts cover
retained records, and runtime retention is not a permanent business archive.
Persist accepted field provenance in customer working data when it must outlive
the run; see [Repair CRM records](https://deepline.com/docs/guides/crm-data-quality-automation.md).

## 5. Reconcile usage separately

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline billing usage --run-id <run-id> --json
deepline billing usage --request-id <job_id> --json
```

Choose the form for the operation you started. Do not combine the two scopes.
Pending or missing amounts do not establish zero usage.
Org balance changes can include other callers.

For credit or cap failures, follow the returned recovery action.
Do not silently change to another paid route or remove an org cap.

## 6. Diagnose connections and external writes

A provider 401 or 403 indicates an access problem, not an empty dataset.
Check the intended org connection and the selected action's requirements.
Only owners and admins can connect integrations through the supported flow.

A write timeout can leave an uncertain destination outcome. Read and reconcile
that state before repeating the mutation. A successful connection does not
prove that every property update is allowed.

Use [Integrations](https://deepline.com/docs/integrations.md), [Repair CRM records](https://deepline.com/docs/guides/crm-data-quality-automation.md),
and [Integrate a Play into your app](https://deepline.com/docs/sdk-v2/production-integration.md) for the specific path.

## 7. Diagnose Database access

A successful empty query means no returned matches under that query.
A permission error means the statement did not establish those data facts.

Use [Query a database](https://deepline.com/docs/database-access.md) for permitted customer SQL.
Customer-owned tables and Deepline-managed views have different write rules.
A direct Postgres integration uses its own connected database and permissions.

## 8. Prepare a useful report

Record the expected result, observed result, operation, and exact error.
Keep the relevant run or execution identity for a targeted follow-up.
Exclude credentials and unrelated customer records.

> [!TIP]
>
> The report identifies the failed boundary and whether work may already exist.
> It does not substitute an empty result, zero charge, or a fresh run for
> uncertainty.

Ask your agent which evidence supports its diagnosis. If the answer is unclear,
inspect the existing work before making another paid or mutating request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.