# client_body_temp_file_write() failed (28: No space left on device) while reading client request body

- **ID:** `nginx/client-body-temp-file-write-failed`
- **Domain:** nginx
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The filesystem partition where nginx stores temporary client body files (usually /var/lib/nginx/tmp or /tmp) is full.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| nginx-1.24.0 | active | — | — |
| nginx-1.25.3 | active | — | — |
| nginx-1.26.0 | active | — | — |

## Workarounds

1. **Free up space on the partition or move the temp directory to a partition with more space. Example:
sudo du -sh /var/lib/nginx/tmp
sudo rm -rf /var/lib/nginx/tmp/*
# Or change path in nginx.conf:
client_body_temp_path /data/nginx/tmp 1 2;** (95% success)
   ```
   Free up space on the partition or move the temp directory to a partition with more space. Example:
sudo du -sh /var/lib/nginx/tmp
sudo rm -rf /var/lib/nginx/tmp/*
# Or change path in nginx.conf:
client_body_temp_path /data/nginx/tmp 1 2;
   ```
2. **Increase the partition size if using LVM or cloud storage. For example, on AWS EBS, extend the volume and resize the filesystem.** (90% success)
   ```
   Increase the partition size if using LVM or cloud storage. For example, on AWS EBS, extend the volume and resize the filesystem.
   ```

## Dead Ends

- **** — The buffer only delays temp file creation; large requests will still hit disk. (60% fail)
- **** — It forces all body data into memory, which can cause OOM for large uploads. (50% fail)
- **** — Nginx will fail to create the temp directory and return a permission denied error. (80% fail)
