mix phoenix_kit.doctor (phoenix_kit v1.7.201)

Copy Markdown View Source

Diagnoses PhoenixKit installation, migration, and runtime issues.

Runs a comprehensive suite of checks covering database connectivity, pool configuration, PgBouncer detection, migration state, lock conflicts, and application configuration. Prints a clear pass/fail report with actionable remediation steps.

Usage

$ mix phoenix_kit.doctor
$ mix phoenix_kit.doctor --prefix=auth

Options

  • --prefix - Database schema prefix. When omitted, resolves from config :phoenix_kit, :prefix, then "public" — the same resolution mix phoenix_kit.update / --status use, so a prefixed install is diagnosed against the schema it actually lives in.

Checks Performed

  1. Repo Detection — Can we find and start the Ecto repo?
  2. DB Connectivity — Can we execute a simple query?
  3. Pool Configuration — Pool size, checkout timeout, queue settings
  4. PgBouncer Detection — Is PgBouncer between app and PostgreSQL?
  5. Migration State — PhoenixKit version (COMMENT), schema_migrations alignment
  6. Schema Drift — Columns a migration should have added but the DB lacks
  7. Pending Migrations — Migration files not yet recorded in schema_migrations
  8. UUID Column Types — Detects varchar uuid columns that crash Ecto on startup
  9. NULL UUIDs in FK Sources — Detects NULL uuids that cause infinite backfill loops
  10. Orphaned FK References — Detects orphaned rows that block FK constraint creation
  11. Lock Conflicts — Any blocked or long-running queries?
  12. Orphaned Connections — Idle-in-transaction or stuck connections
  13. Oban Configuration — Queues and plugins that consume pool connections
  14. Supervisor Children — What's running (update_mode vs full)?
  15. Child Start Order — Does the Repo start before PhoenixKit/Oban in application.ex?
  16. Update Mode — Is update_mode active?
  17. daisyUI Version — Is the host's vendored daisyUI recent enough?