{"record":{"id":"d7da5f65864d6ad3","repo":"apache/hadoop","slug":"truncate-is-not-supported-by-baidubosfilesystem","errorCode":null,"errorMessage":"Truncate is not supported by BaiduBosFileSystem","messagePattern":"Truncate is not supported by BaiduBosFileSystem","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BaiduBosFileSystem.java","lineNumber":831,"sourceCode":"            + \"file {} before rename\", dstPath);\n        delete(dstPath, false);\n      }\n    }\n\n    store.rename(pathToKey(srcPath), pathToKey(dstPath),\n        srcStatus.isFile());\n    return true;\n  }\n\n  @Override\n  public Path getWorkingDirectory() {\n    return workingDir;\n  }\n\n  @Override\n  public boolean truncate(Path f, long newLength)\n      throws IOException {\n    throw new UnsupportedOperationException(\n        \"Truncate is not supported by BaiduBosFileSystem\");\n  }\n\n  /**\n   * Set the working directory to the given directory.\n   *\n   * @param newDir the new working directory\n   */\n  @Override\n  public void setWorkingDirectory(Path newDir) {\n    workingDir = newDir;\n  }\n\n  @Override\n  public String getCanonicalServiceName() {\n    return null;\n  }\n}","sourceCodeStart":813,"sourceCodeEnd":849,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BaiduBosFileSystem.java#L813-L849","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nfor (LoggedTaskAttempt a : loggedTask.getAttempts()) {\n  storyInfo.add(getAttemptInfo(zombieJob, a)); // null result -> IAE in convertState\n}\n\n// after\nfor (LoggedTaskAttempt a : loggedTask.getAttempts()) {\n  if (a.getResult() == null\n      || !EnumSet.of(Values.SUCCESS, Values.FAILED, Values.KILLED)\n             .contains(a.getResult())) {\n    LOG.warn(\"Attempt \" + a.getAttemptID() + \" has no usable result; skipped\");\n    continue;\n  }\n  storyInfo.add(getAttemptInfo(zombieJob, a));\n}","handlingStrategy":"validation","validationCode":"static boolean isKnownResult(Values v) {\n  return v == Values.SUCCESS || v == Values.FAILED || v == Values.KILLED;\n}","typeGuard":"static boolean hasUsableResult(LoggedTaskAttempt a) {\n  Values r = (a == null) ? null : a.getResult();\n  return r == Values.SUCCESS || r == Values.FAILED || r == Values.KILLED;\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["hadoop","rumen","enum-validation","job-trace","missing-field"],"backgroundTag":"invalid-enum-state","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}