# 243: NOT_ENOUGH_SPACE (code 243)

> The server could not reserve disk space for a new part, merge or mutation; the disk under the data path is out of room.

Source: https://sqlly.app/errors/clickhouse/not-enough-space
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error code: `243`
- Name: `NOT_ENOUGH_SPACE`
- Category: Resource limits

Error message:

```text
Cannot reserve {size}, not enough space
```

## What it means

`NOT_ENOUGH_SPACE` (243) is raised before any bytes are written: ClickHouse reserves space for each new part, merge and mutation on the target disk, and the reservation failed. `df` can still show free space, because parallel reservations, `keep_free_space_bytes` and the merge rule of keeping free space for the merge's input parts all shrink what the server may use.

## Common causes

- The disk or volume under the data path is genuinely full, often by ClickHouse's own log tables.
- Free space exists but is reserved by concurrent merges, mutations and inserts.
- The filesystem ran out of inodes, which looks exactly like a full disk.

## How to fix it

1. Compare what the OS sees with what the server sees.

   ```sql
   SELECT name, path, free_space, total_space, unreserved_space, keep_free_space FROM system.disks;
   ```
2. Find the biggest consumers and drop or add TTL to what you can.

   ```sql
   SELECT database, table, formatReadableSize(sum(bytes_on_disk)) AS size FROM system.parts WHERE active GROUP BY database, table ORDER BY sum(bytes_on_disk) DESC LIMIT 10;
   ```
3. On a full disk, DROP TABLE ... SYNC returns space at once; a plain DROP waits out the cleanup delay.

   ```sql
   DROP TABLE old_log_table SYNC;
   ```

## Reproduce it safely

Use a throwaway container or a loopback filesystem sized in megabytes; never a disk holding real data.

```sql
Point a test container's data path at a tiny loopback filesystem, fill it, and any INSERT raises 243. Never test this on a data disk that matters.
```

## How SQLly helps

Run the biggest-tables query from this page in SQLly and the sizes land in a sortable grid, which makes the space hog obvious.

## Questions

### df shows free space. Why 243?

Merges reserve free space for their source parts before writing, and other queries hold reservations too. Check unreserved_space in system.disks, not just free_space.

### What does the size in the message mean?

The size is the number of bytes the server tried to reserve for the insert, merge or mutation, formatted for humans, for example Cannot reserve 1.00 MiB, not enough space.

## Related errors

- [`242`](https://sqlly.app/errors/clickhouse/table-is-read-only): TABLE_IS_READ_ONLY (code 242)
- [`241`](https://sqlly.app/errors/clickhouse/memory-limit-exceeded): MEMORY_LIMIT_EXCEEDED (code 241)

The code and message text are from the [ClickHouse documentation (system.errors)](https://clickhouse.com/docs/en/operations/system-tables/errors).
