{"record":{"id":"5331e173ab0fe760","repo":"apache/hadoop","slug":"diff-rdiff-is-valid-only-with-update-option","errorCode":null,"errorMessage":"-diff/-rdiff is valid only with -update option","messagePattern":"-diff/-rdiff is valid only with -update option","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java","lineNumber":623,"sourceCode":"        throw new IllegalArgumentException(\"Delete missing is applicable \"\n            + \"only with update or overwrite options\");\n      }\n\n      if (overwrite && syncFolder) {\n        throw new IllegalArgumentException(\"Overwrite and update options are \"\n            + \"mutually exclusive\");\n      }\n\n      if (!syncFolder && append) {\n        throw new IllegalArgumentException(\n            \"Append is valid only with update options\");\n      }\n      if (skipCRC && append) {\n        throw new IllegalArgumentException(\n            \"Append is disallowed when skipping CRC\");\n      }\n      if (!syncFolder && (useDiff || useRdiff)) {\n        throw new IllegalArgumentException(\n            \"-diff/-rdiff is valid only with -update option\");\n      }\n\n      if (useDiff || useRdiff) {\n        if (StringUtils.isBlank(fromSnapshot) ||\n            StringUtils.isBlank(toSnapshot)) {\n          throw new IllegalArgumentException(\n              \"Must provide both the starting and ending \" +\n                  \"snapshot names for -diff/-rdiff\");\n        }\n      }\n      if (useDiff && useRdiff) {\n        throw new IllegalArgumentException(\n            \"-diff and -rdiff are mutually exclusive\");\n      }\n\n      if (verboseLog && logPath == null) {\n        throw new IllegalArgumentException(","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java#L605-L641","documentation":"Error \"-diff/-rdiff is valid only with -update option\" thrown in apache/hadoop.","triggerScenarios":"distcp -diff/-rdiff is specified without -update.","commonSituations":"See trigger scenarios.","solutions":["Add -update when using -diff or -rdiff.","Drop the diff options if update semantics are not wanted."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}