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

# Check machine setup

Check what each machine has of what Mirage needs there, and change nothing: whether it answers and how fast, what serving the workspace there takes for its `mount_type` (sshfs, mirage-fuse, the FUSE device, fusermount, or macFUSE on a Mac), and whether its runs join a cgroup of their own. Each finding has a `fix` where there is something to do.

A tool Mirage installs itself at the first mount is `missing` with no `fix`. A machine that reaching would start or resume, such as an E2B sandbox the workspace is not connected to, is `not_checked`. The `fix` for mirage-fuse names the version of the running Mirage.

> [accordion] Errors
>
> | Status | Meaning |
> | - | - |
> | `400` | The request is malformed: the body is not JSON (`invalid_json`) or not a JSON object, a field is missing (`missing_field`), unknown (`unknown_field`) or has a wrong value (`invalid_value`), or the request is otherwise invalid (`invalid_request`). `param` names the field at fault. |
> | `401` | The token is missing or wrong (`unauthorized`). |
> | `404` | The workspace, session, job, file or route does not exist, or the caller may not see it (`not_found`). |
> | `429` | Past a rate limit (`rate_limited`), or a new session past max\_sessions (`session_limit`). |
>
> See [error examples and recovery steps](https://docs.mirage.strukto.ai/api/errors.md). The [complete OpenAPI contract](https://github.com/strukto-ai/mirage/blob/main/docs/openapi.yaml) includes every response schema.


## OpenAPI

````yaml /openapi.yaml get /v1/workspaces/{workspace_id}/doctor
openapi: 3.2.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: http://127.0.0.1:8765
    description: A local server on its default port
security:
  - bearerAuth: []
tags:
  - name: Workspace operations
    x-group: Workspaces
  - name: Workspaces
    x-group: Lifecycle
    parent: Workspace operations
  - name: Sessions
  - name: Shell
    parent: Workspace operations
  - name: VFS
    parent: Workspace operations
  - name: Tools
  - name: Documents
    x-group: Agent Instructions
    parent: Workspace operations
  - name: Snapshots
  - name: Templates
    parent: Configuration
  - name: Saved VFS
    x-group: VFS
    parent: Configuration
  - name: Saved CLIs
    x-group: CLI
    parent: Configuration
  - name: Saved machines
    x-group: Machine
    parent: Configuration
  - name: Configuration
  - name: Policies
    parent: Configuration
  - name: Asks
    parent: Workspace operations
    x-group: Approval requests
  - name: Lines
    parent: Workspace operations
    x-group: Commands
  - name: Jobs
    parent: Workspace operations
  - name: Processes
    parent: Workspace operations
  - name: Machines
    parent: Workspace operations
  - name: Server
  - name: Service
    parent: Server
  - name: Daemon
    parent: Server
  - name: Auth
paths:
  /v1/workspaces/{workspace_id}/doctor:
    get:
      tags:
        - Machines
      summary: Check machine setup
      operationId: doctor_v1_workspaces__workspace_id__doctor_get
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: machine
          in: query
          required: false
          description: Only this machine, in `provider:name` format.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineFindingList'
              example:
                items:
                  - machine: host:my-laptop
                    check: reachable
                    state: ok
                    detail: the workspace's own host
                    fix: null
                  - machine: docker:box
                    check: reachable
                    state: ok
                    detail: 0.1 s
                    fix: null
                  - machine: docker:box
                    check: mirage-fuse
                    state: missing
                    detail: none speaking fsproto 1, and no uv or npm to install one
                    fix: uv tool install mirage-fuse==0.1.0
                  - machine: docker:box
                    check: cgroup
                    state: missing
                    detail: the cgroup tree is read-only, so a stop scans /proc
                    fix: null
                  - machine: e2b:sandbox
                    check: reachable
                    state: not_checked
                    detail: >-
                      not running for this workspace; reaching it would start
                      it, so it is checked when a program first runs
                    fix: null
components:
  parameters:
    workspaceId:
      name: workspace_id
      in: path
      required: true
      description: Workspace ID.
      schema:
        type: string
      example: demo
  schemas:
    MachineFindingList:
      properties:
        items:
          items:
            $ref: '#/components/schemas/MachineFindingResponse'
          type: array
      required:
        - items
      type: object
    MachineFindingResponse:
      properties:
        machine:
          type: string
          title: Machine
          description: The machine's full name, `type:name`.
        check:
          type: string
          title: Check
          description: >-
            What the check looks for, one of `reachable`, `sshfs`,
            `mirage-fuse`, `/dev/fuse`, `fusermount`, `macFUSE` and `cgroup`.
        state:
          $ref: '#/components/schemas/FindingState'
        detail:
          type: string
          title: Detail
          description: >-
            What the check found, such as how long the machine took to answer or
            where a tool is. Its wording can change; never parse it.
        fix:
          anyOf:
            - type: string
            - type: 'null'
          title: Fix
          description: >-
            What to do about it, a command to run where one does it; null where
            nothing need be done or nothing can.
      required:
        - machine
        - check
        - state
        - detail
        - fix
      type: object
    FindingState:
      type: string
      enum:
        - ok
        - missing
        - failed
        - not_checked
      title: FindingState
      description: >-
        What a check found. `ok` when what it looks for is there; `missing` when
        it is not, with what that costs in `detail`; `failed` when the machine
        did not answer; `not_checked` when reaching the machine would start or
        resume it.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default
        local mode with no token accepts requests without one.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.