> ## Documentation Index
> Fetch the complete documentation index at: https://docs.substrate.42.pe/llms.txt
> Use this file to discover all available pages before exploring further.

# substrate diagnose — Environment and Health Report

> substrate diagnose prints a full health report of your Substrate installation and exits non-zero if any probe fails. Include in all bug reports.

Run `substrate diagnose` when something is wrong — or before filing a bug report. It exits non-zero if any probe fails, and every probe is wrapped so that a missing or malformed `config.json` produces a diagnostic line rather than a crash. Pair its output with `substrate logs --errors` to answer most first-round questions on an issue.

## Usage

```shell theme={null}
substrate diagnose
```

## What It Reports

| Probe           | Tells you                                                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Environment** | Node version, platform, the binary's version and schema version.                                                           |
| **Substrate**   | Whether `.substrate/` exists, and whether `config.json` parses.                                                            |
| **Boards**      | Whether the substrate loads, and how many boards, policies, and members.                                                   |
| **Database**    | Whether `data.sqlite` opens, and its current schema version.                                                               |
| **Server**      | Whether a `serve` is live and which port it bound, read from `.substrate/serve.json`, falling back to probing `7475–7499`. |
| **Skill**       | Whether the installed agent skill has drifted from this binary.                                                            |
| **Log**         | Recent error activity from `.substrate/logs/substrate.log`.                                                                |

<Tip>
  Include the full output of `substrate diagnose` in every bug report, paired with `substrate logs --errors`. Together they answer most first-round questions.
</Tip>
