apache/hadoop · error · UnsupportedOperationException
Truncate is not supported by BaiduBosFileSystem
Error message
Truncate is not supported by BaiduBosFileSystem
What it means
ZombieJob.convertState() maps the logged Values enum (SUCCESS, FAILED, KILLED) to run-state States and throws IllegalArgumentException('unknown status <v>') for anything else, including null. It is invoked whenever a logged attempt/job result is translated into a simulation state (getTaskAttemptInfo paths). A null Values is by far the most common trigger: rumen JSON traces mark missing data as null, so an attempt record without a 'result' field fails here.
Source
Thrown at hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BaiduBosFileSystem.java:831
+ "file {} before rename", dstPath);
delete(dstPath, false);
}
}
store.rename(pathToKey(srcPath), pathToKey(dstPath),
srcStatus.isFile());
return true;
}
@Override
public Path getWorkingDirectory() {
return workingDir;
}
@Override
public boolean truncate(Path f, long newLength)
throws IOException {
throw new UnsupportedOperationException(
"Truncate is not supported by BaiduBosFileSystem");
}
/**
* Set the working directory to the given directory.
*
* @param newDir the new working directory
*/
@Override
public void setWorkingDirectory(Path newDir) {
workingDir = newDir;
}
@Override
public String getCanonicalServiceName() {
return null;
}
}View on GitHub (pinned to 2add963021)
Solutions
- Repair or filter the trace: drop attempt records whose 'result' is absent before replay, or re-generate the trace with the rumen tooling so every attempt carries a result.
- If you control the LoggedJob objects, ensure setResult(...) is always called with SUCCESS/FAILED/KILLED.
- Guard before simulation: skip attempts with unknown/null result and log them instead of letting the deep convertState() call abort the run.
Example fix
// before
for (LoggedTaskAttempt a : loggedTask.getAttempts()) {
storyInfo.add(getAttemptInfo(zombieJob, a)); // null result -> IAE in convertState
}
// after
for (LoggedTaskAttempt a : loggedTask.getAttempts()) {
if (a.getResult() == null
|| !EnumSet.of(Values.SUCCESS, Values.FAILED, Values.KILLED)
.contains(a.getResult())) {
LOG.warn("Attempt " + a.getAttemptID() + " has no usable result; skipped");
continue;
}
storyInfo.add(getAttemptInfo(zombieJob, a));
} Defensive patterns
Strategy: validation
Validate before calling
static boolean isKnownResult(Values v) {
return v == Values.SUCCESS || v == Values.FAILED || v == Values.KILLED;
} Type guard
static boolean hasUsableResult(LoggedTaskAttempt a) {
Values r = (a == null) ? null : a.getResult();
return r == Values.SUCCESS || r == Values.FAILED || r == Values.KILLED;
} Prevention
- Filter attempts/jobs with null or unknown 'result' out of the trace before simulation.
- Always set a valid Values result on fabricated LoggedTaskAttempt objects.
- Log skipped records so trace quality problems are visible during replay.
When it happens
Trigger: A LoggedTaskAttempt/LoggedJob whose getResult() is null (missing 'result' in the trace JSON) reaching getTaskAttemptInfo(...)/scaleInfo(...); hand-built LoggedTaskAttempt objects where setResult() was never called; a future/unknown Values constant added by a newer trace format.
Common situations: Replaying rumen traces produced by patched Hadoop versions that omit result for some attempts; traces edited or truncated so records lose fields; unit-test fixtures that build LoggedTaskAttempt without result.
Related errors
- user accessKey and secretAccessKey should not be null
- Can not open a folder
- Failed to rename %s to %s, file already exists or not empty!
- NoSuchUpload
- Key '" + key + "' does not exist in BOS
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/d7da5f65864d6ad3.
Report an issue: GitHub.