apache/hadoop · error · DiskErrorException
No space available in any of the local directories
Error message
No space available in any of the local directories${pathNames} on host${hostname} What it means
Thrown by LocalDirAllocator.getLocalPathForWrite when total available capacity across all configured local directories is zero and the requested size is unknown (roulette selection). Every local dir is full or unusable; the path names and hostname are included.
Solutions
- Free disk space on the configured local directories.
- Add more directories to the local-dir list or clean up old temp files.
- Check per-directory capacity limits and disk health on host${hostname}.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java:493 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/c3fad03487d861a3.
Report an issue: GitHub.
Appendix: source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalDirAllocator.java:493
}
}
note(history, "Directory count is %d; total available capacity is %,d",
dirCount, totalAvailable);
if (size == SIZE_UNKNOWN) {
//do roulette selection: pick dir with probability
// proportional to available size
note(history, "Size not specified, so picking directories at random.");
if (totalAvailable == 0) {
// log error and history
String newErrorText = E_NO_SPACE_AVAILABLE + pathNames
+ " on host" + getHostname();
LOG.error(newErrorText);
LOG.error(history.toString());
// then raise the exception
throw new DiskErrorException(newErrorText);
}
// Keep rolling the wheel till we get a valid path
Random r = new java.util.Random();
while (numDirsSearched < numDirs && returnPath == null) {
long randomPosition = (r.nextLong() >>> 1) % totalAvailable;
int dir = 0;
while (randomPosition > availableOnDisk[dir]) {
randomPosition -= availableOnDisk[dir];
dir++;
}
ctx.dirNumLastAccessed.set(dir);
final Path localDir = ctx.localDirs[dir];
returnPath = createPath(localDir, pathStr, checkWrite);
if (returnPath == null) {
totalAvailable -= availableOnDisk[dir];
availableOnDisk[dir] = 0; // skip this disk
numDirsSearched++;View on GitHub (pinned to 2add963021)