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
31 changes: 31 additions & 0 deletions docs/reference/error-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Recognize an error programmatically by running with `--json` and matching on `er

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](../product/error-conventions.md).

Codes raised by the command families the CLI mounts are listed here too, because the hosted reference is where their errors' docs links point. `pnpm check:error-reference` verifies only the codes in this repository's source, so a family's entries are kept current by hand when the CLI moves to a new release of that family.

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 Management 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:
Expand All @@ -16,6 +18,7 @@ Namespaces:
| `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 |
| `DEV` | Running an app on this machine with Composer (`prisma dev`, `prisma dev url`, `prisma dev stop`, `prisma emulator list`) |
| `FEEDBACK` | Sending product feedback (`prisma feedback`) |
| `GIT` | Git repository connections (`prisma git`) |
| `INIT` | Project initialization diagnostics (`prisma init`) |
Expand Down Expand Up @@ -218,6 +221,34 @@ The `prisma telemetry status|enable|disable` commands could not resolve the user

The typed path routed to no command (stricli's route failure, mapped at the adapter boundary) and no redirect claims it; next actions carry up to three "did you mean" suggestions ranked by edit distance over command paths and their prefixes, plus a pointer to `--help`. Exits 2. Meta: none.

## DEV

These codes come from Composer, the command family behind `prisma dev`, `prisma dev url`, `prisma dev stop` and `prisma emulator list`. A node is one service, database or bucket in your app; its address is its name in the app, with dots for a nested node (`catalog.database`). Each node runs on a local emulator: a program on this machine that stands in for Prisma Cloud.

### DEV.ADDRESS_UNKNOWN

`prisma dev url <address>` named an address that the app `prisma dev` last ran from this directory does not have. The `why` lists the addresses that are recorded for it. The fix is to pass one of those; a nested node has a dotted address, such as `catalog.database`. Meta: `address`, `known` (the recorded addresses).

### DEV.EMULATOR_FAILED

A local emulator answered a request with an error. `prisma dev url`, `prisma dev stop` and `prisma dev` raise it when the emulator that runs a node fails a request. In `prisma emulator list` it is not a failure of the command: the emulator is listed with this code and the emulator's message instead of its instances, and the command still exits `0`. Meta: none.

### DEV.EMULATOR_UNREACHABLE

A local emulator could not be reached. `prisma dev url` raises it when the emulator that runs the node is not running; the fix is to run `prisma dev <entry>` in this directory, which starts the emulators the app needs. It is also raised when an emulator is registered and its process is alive but it did not accept the connection; the fix then is to run the command again, and if it keeps failing, to end the emulator's process so the next `prisma dev` starts a new one. Meta: `address` and `kind` (the node's address and kind) when the emulator is not running; `url` (the emulator's address) when it did not accept the connection.

### DEV.EMULATORS_DIR_INVALID

Any command that reaches the local emulators (`prisma dev`, `prisma dev url`, `prisma dev stop`, `prisma emulator list`) found the `PRISMA_COMPOSER_EMULATORS_DIR` environment variable set to a relative path. Every process that starts or reaches the local emulators resolves this directory, and a relative path would name a different directory in each working directory. The fix is to set it to an absolute path (`~` is not expanded) or to unset it, which uses `~/.prisma-composer/emulators`. Meta: `variable`, `value`.

### DEV.NOT_RUNNING

`prisma dev url` named a node that is not running, so it has no URL that answers. The `why` says which of three cases applies: the node is stopped (`prisma dev stop`, `prisma dev` ending, and running another app in this directory all stop an app's services and database servers; the fix is to run `prisma dev <entry>` in this directory); the node exited after it started and is being restarted or was held after repeated crashes (the fix is to read its log, whose path is in the `fix` and `meta.logPath` when known, fix the cause and rebuild); or the emulator no longer has it, for example because a Composer upgrade discarded the emulator's state (running `prisma dev <entry>` creates it again, empty). Meta: `address`, `kind`, `state`, and `logPath` when known.

### DEV.NOT_STARTED_HERE

`prisma dev url` or `prisma dev stop` ran in a directory where `prisma dev` has not run. An app's local services, databases and buckets are recorded in the directory `prisma dev` runs from, and there is no such record here. The fix is to run `prisma dev <entry>` in this directory, or to run the command from the directory where `prisma dev` ran. Meta: `cwd`.

## FEEDBACK

### FEEDBACK.EMAIL_INVALID
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"@manypkg/tools": "^2.1.2",
"@prisma/cli-engine": "workspace:0.9.0",
"@prisma/composer-cli": "0.31.0",
"@prisma/composer-cli": "0.32.0",
"@prisma/compute-sdk": "0.43.0",
"@prisma/management-api-sdk": "1.80.0",
"@prisma/orm-toolchain": "8.0.0-rc.18",
Expand All @@ -62,7 +62,7 @@
"open": "^11.0.0"
},
"devDependencies": {
"@prisma/composer": "0.31.0",
"@prisma/composer": "0.32.0",
"@prisma/credentials-store": "^7.8.0",
"@repo/cli-conformance": "workspace:8.0.0-rc.23",
"@repo/cli-telemetry": "workspace:8.0.0-rc.23",
Expand Down
2 changes: 1 addition & 1 deletion packages/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"@manypkg/tools": "^2.1.2",
"@prisma/cli-engine": "workspace:0.9.0",
"@prisma/composer-cli": "0.31.0",
"@prisma/composer-cli": "0.32.0",
"@prisma/compute-sdk": "0.43.0",
"@prisma/management-api-sdk": "1.80.0",
"@prisma/orm-toolchain": "8.0.0-rc.18",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading