URL: /docs/doctor

---
title: Readiness check
description: "`turntable doctor`: a read-only check an operator runs before going live, with a fix for everything it finds."
---

`turntable doctor` checks that an instance is ready to go live and says what to fix. It reads the same `TURNTABLE_*` environment as `turntable serve`, opens the database read-only, creates nothing, starts nothing, and never prints a secret: it says a key is present and well formed, never what it is.

```sh
turntable doctor --data-dir /data          # human readable
turntable doctor --data-dir /data --json   # for a deploy script
```

Exit status is 1 when a check fails, and with `--strict` when one warns. The report is instance-wide (master key, App credentials, provider, proxy TLS, release channel), so it is for the instance operator only: run it on the host. No org token, of any role, can read it, and it is never an MCP tool. With no shell (a hosted instance), the instance administrator's `tti_` token calls `instance_doctor` over REST, which returns the same checks with fixed sentences only. An in-process owner (the local CLI) can call the `doctor` operation, which returns the same checks with fixed sentences only: raw error text (a database or provider error) is shown by the command on your terminal and never returned by the operation. Runs triggered through a server are cached for 30 seconds. The release channel check calls a read-only `health` endpoint on the lane, authenticated with the request key; it changes nothing.

Each finding is `pass`, `warn` or `fail`, and each warning or failure carries a one-line fix.

| Area | What it checks |
| --- | --- |
| Process | The process is not root (the privilege drop happened), and the data directory exists, is owned by this user and is writable and not world-writable. |
| Keys | The master key file is present, exactly 32 bytes and private to its owner. Hosted, a missing key is a failure. |
| Database | The database opens and answers, and every migration this binary carries is applied. Pending migrations warn (back up first: they only go forward). A database written by a newer version fails, so an older binary is not started against it. |
| GitHub | An App is registered, and its id, private key and webhook secret exist and open under the master key. |
| Provider | The provider's own read-only checks. Daytona: the key file is readable and the API answers, the org usage endpoint the CPU check relies on answers, and the named snapshot exists. No sandbox is created, started or deleted. Docker: the daemon answers. |
| Proxy | The secrets proxy's public TLS certificate: both files readable, the key belongs to the certificate, it is valid now, it names its advertised host, and it does not expire within 14 days. |
| Network | Forwarded-header settings against observed traffic, and that plain http is redirected to https (here, behind a trusted proxy, or by the proxy in front) with HSTS on. |
| Release | If a release channel is configured, the lane answers over it and accepts this process's request key (the probe is an idempotent revoke of a made-up attempt). |
| Limits | Whether quotas are set. None set is a warning on a hosted instance, and fine for one operator. |
| Ingest | `poll_health`: warns when a repo has failed to poll 3 times in a row, has not polled successfully within 3 of its intervals (this catches a stopped loop or a skipped stale binding), or when the anonymous GitHub budget is at its floor (5 requests left). It reads the poller in this process, so it passes where no poller runs (`turntable doctor` on the command line, or a worker in another process). `instance_ingest_status` says which repo and why. |
| Approvals | `human_approval_key_policy`: warns when a project resolves to `untrusted_run_approval = human` while its org key policy is `any`, because a key file on a machine where agents run lets an agent sign an approval. Fixed sentence, naming no org, project or key. Server only, like the next check. `human_approval_approvers`: warns when a project resolves to `untrusted_run_approval = human` while its org has no active approver whose key satisfies the org key policy (revoked since, or the policy tightened), so its held runs cannot be approved. It names no org, project or key. It runs in the server (`instance_doctor`, `doctor`); `turntable doctor` on the command line has no settings layers to resolve and passes it as not checked. |

A hosted instance (`--hosted` or `TURNTABLE_HOSTED=1`) is held to a stricter standard: a missing master key, GitHub App or https redirect is a failure rather than a warning.

## What it does not do

It does not prove a job will run: it never creates a sandbox, so a provider problem that only shows at create time is not found. It does not check the network path from a sandbox to the proxy. Run one real job after `doctor` passes.
