diff --git a/docs/reference/error-reference.md b/docs/reference/error-reference.md index fd43568e..ed9fa939 100644 --- a/docs/reference/error-reference.md +++ b/docs/reference/error-reference.md @@ -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: @@ -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`) | @@ -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
` 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 ` 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 ` 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 ` 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 ` in this directory, or to run the command from the directory where `prisma dev` ran. Meta: `cwd`. + ## FEEDBACK ### FEEDBACK.EMAIL_INVALID diff --git a/packages/cli/package.json b/packages/cli/package.json index 889e650d..42ed699c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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", @@ -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", diff --git a/packages/prisma/package.json b/packages/prisma/package.json index ca76f620..5a9974c2 100644 --- a/packages/prisma/package.json +++ b/packages/prisma/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1496a188..217365ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: workspace:0.9.0 version: link:../cli-engine '@prisma/composer-cli': - specifier: 0.31.0 - version: 0.31.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) + specifier: 0.32.0 + version: 0.32.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) '@prisma/compute-sdk': specifier: 0.43.0 version: 0.43.0(@prisma/management-api-sdk@1.80.0)(rollup@4.62.2) @@ -61,8 +61,8 @@ importers: version: 11.0.0 devDependencies: '@prisma/composer': - specifier: 0.31.0 - version: 0.31.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) + specifier: 0.32.0 + version: 0.32.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) '@prisma/credentials-store': specifier: ^7.8.0 version: 7.8.0 @@ -213,8 +213,8 @@ importers: specifier: workspace:0.9.0 version: link:../cli-engine '@prisma/composer-cli': - specifier: 0.31.0 - version: 0.31.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) + specifier: 0.32.0 + version: 0.32.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) '@prisma/compute-sdk': specifier: 0.43.0 version: 0.43.0(@prisma/management-api-sdk@1.80.0)(rollup@4.62.2) @@ -1342,14 +1342,14 @@ packages: '@oxc-project/types@0.146.0': resolution: {integrity: sha512-XC0QsnnhVe7sLIWmYmdPw7x5P0h4W8vUU3Nv1ySgWXtvCz8NizoAEpGXA0sOYoJQV2Rl13LgURAHQ5cI5ILCSA==} - '@prisma/composer-cli@0.31.0': - resolution: {integrity: sha512-a7E0dnq2D/352qxfDt64jSIxfZT5C4xZpCd4DKsmfGq5GfvbFohsXZpzVZ8dLqQnNYlScD03QxqWnV29yTgJlw==} + '@prisma/composer-cli@0.32.0': + resolution: {integrity: sha512-nxUHq2Ddu961U937yXOpmYvpWVXKL0xbWQRifglLJK8wTxE9Ur9260a7N4AzNd98PqTEE/3fT7xIfIpVL6si2w==} engines: {node: ^22.18.0 || ^24.11.0 || >=26.0.0} peerDependencies: '@prisma/cli-engine': 0.7.0 - '@prisma/composer@0.31.0': - resolution: {integrity: sha512-sMU6rW1MyymJyre1x3b/JxQG/PqJn95DT76FWj6UZMLVk7ERskGOrB2S8Aum7uExtEAiz05Ow1D4Ok3F6XgzQQ==} + '@prisma/composer@0.32.0': + resolution: {integrity: sha512-IBuxF4o2Rypy5CDFtTyOXyoDgHdcv3pS5R/R+WRJYNvpkMa1IL3mOeMYWu19tHJlhIoDaWckyrdjXrjKa072jQ==} engines: {node: ^22.18.0 || ^24.11.0 || >=26.0.0} '@prisma/compute-sdk@0.43.0': @@ -4059,10 +4059,10 @@ snapshots: '@oxc-project/types@0.146.0': {} - '@prisma/composer-cli@0.31.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0)': + '@prisma/composer-cli@0.32.0(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@prisma/cli-engine@packages+cli-engine)(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0)': dependencies: '@prisma/cli-engine': link:packages/cli-engine - '@prisma/composer': 0.31.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) + '@prisma/composer': 0.32.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0) alchemy: 2.0.0-beta.83(@effect/vitest@4.0.3(effect@4.0.3)(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))))(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(effect@4.0.3)(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(ws@8.21.0) cross-spawn: 7.0.6 effect: 4.0.3 @@ -4096,7 +4096,7 @@ snapshots: - vitest - ws - '@prisma/composer@0.31.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0)': + '@prisma/composer@0.32.0(@types/node@22.19.19)(@vercel/nft@1.10.2(rollup@4.62.2))(hono@4.11.4)(mongodb@6.21.0(@aws-sdk/credential-providers@3.1107.0))(pg@8.23.0)(typescript@6.0.3)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@22.19.19)(vite@7.3.5(@types/node@22.19.19)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))(ws@8.21.0)': dependencies: '@effect/sql-d1': 4.0.3(effect@4.0.3) '@effect/sql-sqlite-do': 4.0.3(effect@4.0.3)