Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions apps/docs/content/docs/cli/error-reference.mdx
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
---
title: Error reference
description: Every structured error code the unified Prisma CLI can emit, by namespace, with the condition that raises it.
description: The structured error codes of the Prisma CLI platform commands, by namespace, with the condition that raises each one.
url: /cli/error-reference
metaTitle: Error reference | Prisma CLI
metaDescription: Every structured error code the unified Prisma CLI can emit, by namespace, with the condition that raises it.
metaDescription: The structured error codes of the Prisma CLI platform commands, by namespace, with the condition that raises each one.
---

{/* Generated by scripts/generate-error-reference.mjs from
https://github.com/prisma/prisma-cli/blob/main/docs/reference/error-reference.md
Do not edit by hand — changes are overwritten by the sync workflow. */}
Do not edit by hand. The sync workflow overwrites changes. */}

Every user-facing error the unified Prisma CLI emits is a structured envelope identified by a dotted `NAMESPACE.SUBCODE` code (see [Error Conventions](https://github.com/prisma/prisma-cli/blob/main/docs/product/error-conventions.md) and [ADR 0003](https://github.com/prisma/prisma-cli/blob/main/docs/architecture/adrs/0003-structured-output-and-errors.md)). This page lists every published code. Each code anchors as `#<CODE>` — the fragment an emitted error's `docsUrl` resolves to. This page is generated from the canonical registry in the `prisma/prisma-cli` repository, whose CI requires every code in production source to be documented before it ships.
Every user-facing error the unified Prisma CLI emits is a structured envelope identified by a dotted `NAMESPACE.SUBCODE` code (see [Error Conventions](https://github.com/prisma/prisma-cli/blob/main/docs/product/error-conventions.md) and [ADR 0003](https://github.com/prisma/prisma-cli/blob/main/docs/architecture/adrs/0003-structured-output-and-errors.md)). This page lists the codes from every `prisma` command except the Prisma ORM ones. The codes from `prisma contract`, `prisma db`, `prisma migration`, and `prisma orm`, and the codes your app can raise at runtime, are on the [Prisma ORM error reference](/orm/reference/error-reference). When an error prints a `docsUrl`, that link opens the code's entry on this page. This page is generated from the `prisma/prisma-cli` repository.

One exception: the `CLI.*` codes on this page come from the command-line layer that every `prisma` command runs through, for its arguments, for loading `prisma.config.ts`, for prompts, and for consent. They are on this page even when you ran a Prisma ORM command. `CLI.CONFIG_SECTION_INVALID` from `prisma contract emit` is one of them. The Prisma ORM commands also raise `CLI.*` codes of their own, and those are on the [Prisma ORM error reference](/orm/reference/error-reference). If a `CLI.*` code is not on this page, it is on the other.

Recognize an error programmatically by running with `--json` and matching on `error.code` in the emitted envelope — never on message text. Envelopes carry `message`, and optionally `why`, `fix`, `where`, `meta`, `cause`, `nextActions`, and `docsUrl`.

Most codes on this page are expected failures. Some are warn-severity diagnostics that ride a successful run: the command completes and exits `0`, and the diagnostic carries the code (the entry says so where it applies). The process exit-code contract is in [Error Conventions](https://github.com/prisma/prisma-cli/blob/main/docs/product/error-conventions.md).

Every code on this page is assigned where the error is raised, and this page lists every code the CLI can emit. No boundary invents a code from a server response or rewrites one on the way out, so an error's code never depends on which command you reached the failure through. When a REST API request fails, the CLI raises the domain's registered `*.API_ERROR` code and carries the API's own code and HTTP status in `meta.apiCode` and `meta.status`, where they are data you can read rather than a code you have to guess at.

Namespaces:

| Namespace | Covers |
| --- | --- |
| `AUTH` | Workspace authentication and sessions (`prisma auth`, credential resolution) |
| `BRANCH` | Branch listing (`prisma branch`) |
| `BUCKET` | Bucket and bucket-key management (`prisma bucket`) |
| `CLI` | Engine-level invocation: arguments, config loading, prompts, consent, credentials, child processes |
| `FEEDBACK` | Sending product feedback (`prisma feedback`) |
| `GIT` | Git repository connections (`prisma git`) |
| `INIT` | Project initialization diagnostics (`prisma init`) |
| `POSTGRES` | Database management (`prisma postgres`) |
| `PROJECT` | Project and environment management (`prisma project`) |
| `SERVICE` | Deployed service management (`prisma service`) |
| `SKILLS` | Agent-skill delivery (`prisma skills`) |
Every code on this page is assigned where the error is raised. No boundary invents a code from a server response or rewrites one on the way out, so an error's code never depends on which command you reached the failure through. When a REST API request fails, the CLI raises the domain's registered `*.API_ERROR` code and carries the API's own code and HTTP status in `meta.apiCode` and `meta.status`, where they are data you can read rather than a code you have to guess at.

Namespaces on this page:

- [`AUTH`](#auth): Workspace authentication and sessions (`prisma auth`, credential resolution)
- [`BRANCH`](#branch): Branch listing (`prisma branch`)
- [`BUCKET`](#bucket): Bucket and bucket-key management (`prisma bucket`)
- [`CLI`](#cli): Engine-level invocation: arguments, config loading, prompts, consent, credentials, child processes
- [`FEEDBACK`](#feedback): Sending product feedback (`prisma feedback`)
- [`GIT`](#git): Git repository connections (`prisma git`)
- [`INIT`](#init): Project initialization diagnostics (`prisma init`)
- [`POSTGRES`](#postgres): Database management (`prisma postgres`)
- [`PROJECT`](#project): Project and environment management (`prisma project`)
- [`SERVICE`](#service): Deployed service management (`prisma service`)
- [`SKILLS`](#skills): Agent-skill delivery (`prisma skills`)

## AUTH

Expand Down
Loading
Loading