# Error processing tar file(exit status 1): unexpected end of tar archive

- **ID:** `docker/tar-stream-eof-unexpected`
- **Domain:** docker
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 77%

## Root Cause

A layer tarball in the Docker image is corrupted or truncated, often due to network interruption during pull, incomplete upload to registry, or disk I/O errors.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 20.10.18 | active | — | — |
| Docker 24.0.2 | active | — | — |
| Registry 2.8.1 | active | — | — |

## Workarounds

1. **Delete the specific corrupted image layer: `docker rmi <image>:<tag>` and then re-pull the image from the registry with `docker pull <image>:<tag>`. If the error persists, the registry image itself is corrupted; push a fresh build.** (80% success)
   ```
   Delete the specific corrupted image layer: `docker rmi <image>:<tag>` and then re-pull the image from the registry with `docker pull <image>:<tag>`. If the error persists, the registry image itself is corrupted; push a fresh build.
   ```
2. **If the image is local, export and re-import: `docker save myimage:latest -o myimage.tar && docker rmi myimage:latest && docker load -i myimage.tar`. This can fix minor tar header corruption.** (70% success)
   ```
   If the image is local, export and re-import: `docker save myimage:latest -o myimage.tar && docker rmi myimage:latest && docker load -i myimage.tar`. This can fix minor tar header corruption.
   ```

## Dead Ends

- **** — Pruning removes all images and containers but does not repair the corrupted layer; the error will reappear when pulling the same image again from the same registry. (85% fail)
- **** — The error is due to data corruption, not timeout; reducing concurrency does not fix the underlying tarball integrity issue. (90% fail)
