{"record":{"id":"63d01ab29c13cd09","repo":"apache/hadoop","slug":"s-unknown-conflict-resolution-mode-s","errorCode":null,"errorMessage":"%s: unknown conflict resolution mode: %s","messagePattern":"(.+?): unknown conflict resolution mode: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/staging/DirectoryStagingCommitter.java","lineNumber":132,"sourceCode":"    Path outputPath = getOutputPath();\n    FileSystem fs = getDestFS();\n    Configuration fsConf = fs.getConf();\n    switch (getConflictResolutionMode(context, fsConf)) {\n    case FAIL:\n      // this was checked in setupJob; temporary files may have been\n      // created, so do not check again.\n      break;\n    case APPEND:\n      // do nothing\n      break;\n    case REPLACE:\n      if (fs.delete(outputPath, true /* recursive */)) {\n        LOG.info(\"{}: removed output path to be replaced: {}\",\n            getRole(), outputPath);\n      }\n      break;\n    default:\n      throw new IOException(getRole() + \": unknown conflict resolution mode: \"\n          + getConflictResolutionMode(context, fsConf));\n    }\n  }\n}\n","sourceCodeStart":114,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/commit/staging/DirectoryStagingCommitter.java#L114-L137","documentation":"IOException from DirectoryStagingCommitter.cleanupJob's default switch branch when getConflictResolutionMode returns a ConflictResolution value that the switch does not handle. In stock Hadoop the enum only has FAIL, APPEND and REPLACE and the config is parsed with ConflictResolution.valueOf (StagingCommitter:833), so an invalid fs.s3a.committer.staging.conflict-mode string fails earlier with IllegalArgumentException. Reaching this branch therefore means an enum constant exists that the switch was never updated for -- a code/version integrity problem, not a config typo.","triggerScenarios":"A custom hadoop-aws build or fork adds a new ConflictResolution constant but does not extend this switch; jars from mismatched Hadoop versions are mixed on the classpath so the enum seen at runtime differs from the one the committer was compiled against.","commonSituations":"Patched hadoop-aws deployed without recompiling all committer classes; different Hadoop versions shared across distributed classpath nodes.","solutions":["Align hadoop-aws and hadoop-common versions on every node so exactly one ConflictResolution enum is on the classpath","If you maintain a fork that adds a conflict mode, add its case to this switch (and the one in PartitionedStagingCommitter)","Verify fs.s3a.committer.staging.conflict-mode is one of fail, append, replace (this surfaces earlier as IllegalArgumentException if not)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"String mode = fsConf.getTrimmed(\"fs.s3a.committer.staging.conflict-mode\", \"append\");\nif (!Arrays.asList(\"fail\", \"append\", \"replace\").contains(mode)) {\n  throw new IOException(\"Invalid conflict mode: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n  committer.cleanupJob(context);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"unknown conflict resolution mode\")) {\n    // enum/switch skew: audit the classpath for mismatched hadoop-aws jars\n    LOG.error(\"Version skew suspected in staging committer\", e);\n  }\n}","preventionTips":["Pin one hadoop-aws version across all nodes and gateways","In forks, treat 'add an enum constant' as requiring a switch-case audit in every committer","Diff runtime jar versions (hadoop classpath, mvn dependency:tree) when this appears"],"tags":["s3a","committer","conflict-resolution","version-mismatch"],"backgroundTag":"unhandled-enum-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}