# Failed to publish artifacts: No space left on device (28)

- **ID:** `cicd/teamcity-build-agent-disk-full`
- **Domain:** cicd
- **Category:** system_error
- **Error Code:** `28`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The TeamCity build agent's disk is full, preventing artifact publication or build execution due to insufficient storage space.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| TeamCity 2022.04+ | active | — | — |
| TeamCity 2023.05+ | active | — | — |
| Linux build agents | active | — | — |

## Workarounds

1. **Stop the TeamCity build agent (`teamcity-agent stop`), clean up old build artifacts and temp files in `<agent-home>/work/` and `<agent-home>/temp/`, then restart the agent (`teamcity-agent start`).** (90% success)
   ```
   Stop the TeamCity build agent (`teamcity-agent stop`), clean up old build artifacts and temp files in `<agent-home>/work/` and `<agent-home>/temp/`, then restart the agent (`teamcity-agent start`).
   ```
2. **Configure the agent to use a different partition with more space by setting `workDir` and `tempDir` in `<agent-home>/conf/buildAgent.properties`: `workDir=/mnt/large_disk/work` and `tempDir=/mnt/large_disk/temp`** (85% success)
   ```
   Configure the agent to use a different partition with more space by setting `workDir` and `tempDir` in `<agent-home>/conf/buildAgent.properties`: `workDir=/mnt/large_disk/work` and `tempDir=/mnt/large_disk/temp`
   ```

## Dead Ends

- **Clearing the build agent's temp directory manually without stopping the agent** — The agent may be actively writing to some files, causing deletion failures or file locks; stopping the agent is required for safe cleanup. (40% fail)
- **Increasing the disk size on the host machine without reconfiguring the agent's build checkout directory** — If the disk is partitioned, increasing the partition may not be possible without downtime, and the agent's build directory may still point to a full partition. (60% fail)
