Troubleshooting#
Start with:
npx rehearsal doctorDoctor names each missing or unsafe item. If you still need help, run
npx rehearsal support, review the report, and attach it to a GitHub issue.
npx rehearsal cannot find the command#
Confirm you are in the project directory and install the current release locally:
npm install --save-dev @rehearsal-db/core
npx rehearsal --helpDo not use sudo or require a global install.
Installation did not create rehearsal.config.mjs#
Rehearsal intentionally skips automatic creation when install scripts are disabled, the install is global or temporary, or more than one workspace application could own the config. From the intended application directory, run:
npx rehearsalChoose Set the stage and approve the preview. This is also the setup path when
using pnpm or Yarn. Existing supported configs stay in place; run
npx rehearsal init --json and inspect data.destination to find the active path.
To move it, follow the config relocation guide.
Setup says this Node.js version is unsupported#
Use a supported Node 22, 24 or 26 release; Node 24 LTS is recommended. With nvm, switch the current shell before installing or running Rehearsal:
nvm install 24
nvm use 24
node --versionThen restore dependencies in the consuming project with its existing package manager. The guide checks Node before writing setup files. See Compatibility for integration-specific runtime limits.
Doctor says Docker is unavailable#
Start Docker Desktop or Colima, confirm docker info, then rerun rehearsal doctor.
Restarting the computer is rarely necessary.
For an unexpected Colima start or stop, inspect npx rehearsal environments and
review the runtime ownership settings. Read-only commands never
start it; automatic startup and owned-idle stopping require explicit settings.
A container stuck in starting or unhealthy is a runtime dependency failure, not
a confirmed migration error or memory shortage. Preserve the safe failure report,
inspect local service health and review available CPU/memory/disk measurements before
retrying. Recognized Supabase startup observations describe provider messages, not
proven causes; unknown means safe evidence was unavailable. Rehearsal does not retry
startup automatically, change engine settings or bypass health checks.
Docker or Colima is out of disk space#
Inspect the active engine without starting it:
npx rehearsal environmentsReview the reported disk warning and configured headroom before starting more work. Runtime lifecycle explains measurements and capacity settings; do not lower thresholds simply to hide recurring failures.
Preview what Rehearsal can safely remove:
npx rehearsal cleanup --include-imagesReview the list, then add --write and the printed --confirm-cleanup digest. Rehearsal
keeps the newest Supabase image for each service, refuses images used by any running or
stopped container, and never runs a global Docker or volume prune. Add
--include-runtime only when this project's disposable database may also be removed.
For example, copy the full digest from your preview:
npx rehearsal cleanup --include-images --write --confirm-cleanup=PASTE_FULL_DIGEST_HEREFor a full Colima disk, follow the engine's reviewed capacity procedure and resource guidance. VM changes can affect other projects. Never substitute global Docker or volume pruning for scoped Rehearsal cleanup.
The guide does not show styled menus#
Rehearsal uses numbered menus when terminal styling is unavailable, NO_COLOR is set, or
--plain is used. Enter the number beside your choice. This is the same workflow and has
the same safety checks.
If bare npx rehearsal prints help, the command is not connected to an interactive
terminal. Run it directly in a terminal rather than through a pipe or background task.
Doctor says the PostgreSQL image is unavailable#
Rehearsal will not download an image during a rehearsal. Pull and review the exact image
declared in rehearsal.config.mjs, then rerun Doctor:
docker pull postgres:17-alpine
npx rehearsal doctorA port is already in use or cannot be bound#
Rerun rehearsal setup to select a different available block. Setup checks both active
listeners and whether every selected port can be bound, then checks again before writing.
For an existing configuration, choose unique non-privileged ports and mirror them in the
dedicated Supabase config when using Supabase. Do not stop an unrelated database to make
defaults fit.
port_in_use reports an occupied bind; port_unavailable reports a denied or
unavailable bind. Neither proves a memory shortage. On Windows/WSL, an excluded TCP
range or host access policy can prevent binding even when no listener is visible.
In Windows PowerShell, inspect the host without changing it:
netsh interface ipv4 show excludedportrange protocol=tcpIf the configured port (for example the tutorial's 59422) is excluded, select a
different available port outside those ranges. For PostgreSQL, review
runtime.databasePort in rehearsal.config.mjs. For Supabase, review the configured
runtime ports and matching dedicated Supabase configuration together. Keep loopback
binding. Do not delete reservations, disable host security, prune resources or stop
someone else's listener to make the default work. Access-denied output is evidence
of a bind problem, not proof of a particular Windows reservation.
Microsoft documents the read-only excluded-port command. Windows database execution still uses the WSL 2 compatibility preview, not native Windows database support.
A candidate migration failed, but SQL and provider output are withheld#
Rehearsal keeps SQL, row values, constraint names and raw provider output private. When the provider supplies a recognized SQLSTATE envelope, it reports that code plus a fixed explanation and next step. PostgreSQL codes are provider-defined conditions, not guesses from the SQL text:
| Code | Meaning | Next step |
|---|---|---|
42601 |
SQL syntax error | Review malformed statements and punctuation. |
23502 |
NOT NULL violation | Review NULL values and backfill before enforcing the requirement. |
23503 |
Foreign-key violation | Review missing referenced rows and migration ordering. |
23505 |
Uniqueness violation | Review duplicates before enforcing uniqueness. |
23514 |
CHECK violation | Existing or newly written rows do not satisfy the constraint; review/backfill them. |
42P01 / 42703 |
Missing table / column | Review schema qualification and migration ordering; this is not a confirmed syntax error. |
Unsupported or conflicting evidence remains unknown. The CLI reference describes structured failure output and attempted-input navigation. Diagnosis does not automatically rewrite SQL, retry, reset or connect to a hosted database.
Inspect rehearsal status after failure. Owned runtime cleanup and baseline preservation
are separate facts; a failed operation does not prove SQL rollback or preservation of
your disposable sandbox edits. A warning that cleanup could not be confirmed requires
review before retrying. Follow the break-and-fix tutorial
to practice safely on synthetic data.
Baseline checksum mismatch#
Do not edit the checksum or manifest. The artifact is no longer the reviewed input. Rebuild the generation through the project-owned baseline process.
Historical migration changed#
Restore the exact represented bytes or intentionally build and review a new baseline. Renaming edited history into the candidate suffix does not repair lineage.
Candidate confirmation mismatch#
Run rehearsal candidates again. Review every filename, then confirm the new digest only
if the exact set is intended.
Migration failed#
Treat the runtime as untrusted. Inspect npx rehearsal status and resolve any cleanup
warning before retrying. Correct a new, unapplied candidate, then rerun Doctor and
candidate review with the new digest. For already deployed history, add a forward
migration instead. Failure does not prove rollback or preservation of sandbox edits.
Application proof failed#
Run the project proof directly against the generated local environment. Fix the app, adapter, fixture expectation, or migration; do not weaken the proof to obtain a pass.
The local application loads a hosted value from .env#
Rehearsal removes undeclared hosted credentials from the child process environment, but
frameworks such as Vite may independently read project .env files after the process
starts. Give the configured startCommand or framework test mode an explicit safe local
override for the affected value. Do not delete or rewrite a developer's normal .env
file as part of a rehearsal.
rehearsal open cannot start the app#
open requires application.readiness in rehearsal.config.mjs. Confirm that its URL
uses localhost, 127.0.0.1, or ::1, matches the app's sandbox port, and returns the
configured status after startup. Rehearsal leaves the verified database runtime running
when application startup fails, so retrying does not discard local database or Storage
changes.
Local authentication fails#
For Google or GitHub, confirm supabase.authentication is declared in
rehearsal.config.mjs, its ignored environment file exists with chmod 600, and the
provider has the printed local Auth callback registered. Rehearsal generates the
disposable Supabase provider block.
For legacy provider settings or a Doctor refusal, follow authentication configuration rather than weakening nonce checks or pasting secrets into tracked files or terminal output.
For the shortest supported copied-account flow, run:
npx rehearsal identity connectLeave that terminal open, then sign in through the sandbox application normally. Rehearsal
waits for one verified match and shows a redacted plan before it changes anything. If it
keeps waiting, finish the provider callback and confirm the reviewed matcher environment
value is available in the terminal that started Rehearsal. Ctrl+C, Ctrl+Z, or choosing
Not now stops only the owned application and leaves the database unchanged.
After a successful connection, sign out and sign in once so the application receives
fresh role claims. Rehearsal remembers the connection in the current disposable runtime;
reset deliberately removes that receipt, so the next copied-account connection requires
review again.
For a refused or ambiguous matcher, use the reported reason and Runtime and identity policies. Complete ordinary local sign-in, confirm the reviewed matcher input and narrow ambiguous matches; never force a claim or bypass conflicting identity evidence.
Runtime changes disappeared#
reset deliberately restores the immutable baseline. stop should preserve Docker
state, but runtime removal or a failed migration discards untrusted state.
Ctrl+Z exits instead of suspending#
This is intentional inside the guided interface. It exits the entire Rehearsal session and restores the terminal. Choose Exit for the same result.
Use --debug only after ordinary output is insufficient. Diagnostics are redacted, but
you should still review output before sharing it publicly.