{"record":{"id":"39cb709de1853c63","repo":"apache/hadoop","slug":"sourcepaths-size-source-paths-are-provided","errorCode":null,"errorMessage":"sourcePaths.size() + \" source paths are provided\"","messagePattern":"sourcePaths\\.size\\(\\) \\+ \" source paths are provided\"","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpSync.java","lineNumber":99,"sourceCode":"\n  private boolean isRdiff() {\n    return context.shouldUseRdiff();\n  }\n\n  /**\n   * Check if three conditions are met before sync.\n   * 1. Only one source directory.\n   * 2. Both source and target file system are DFS or WebHdfs.\n   * 3. There is no change between from and the current status in target\n   *    file system.\n   *  Throw exceptions if first two aren't met, and return false to fallback to\n   *  default distcp if the third condition isn't met.\n   */\n  private boolean preSyncCheck() throws IOException {\n    List<Path> sourcePaths = context.getSourcePaths();\n    if (sourcePaths.size() != 1) {\n      // we only support one source dir which must be a snapshottable directory\n      throw new IllegalArgumentException(sourcePaths.size()\n          + \" source paths are provided\");\n    }\n    final Path sourceDir = sourcePaths.get(0);\n    final Path targetDir = context.getTargetPath();\n\n    final FileSystem srcFs = sourceDir.getFileSystem(conf);\n    final FileSystem tgtFs = targetDir.getFileSystem(conf);\n    final FileSystem snapshotDiffFs = isRdiff() ? tgtFs : srcFs;\n    final Path snapshotDiffDir = isRdiff() ? targetDir : sourceDir;\n\n    checkFilesystemSupport(sourceDir,targetDir,srcFs, tgtFs);\n\n    // make sure targetFS has no change between from and the current states\n    if (!checkNoChange(tgtFs, targetDir)) {\n      // set the source path using the snapshot path\n      context.setSourcePaths(Arrays.asList(getSnapshotPath(sourceDir,\n          context.getToSnapshot())));\n      return false;","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpSync.java#L81-L117","documentation":"Error \"sourcePaths.size() + \" source paths are provided\"\" thrown in apache/hadoop.","triggerScenarios":"DistCpSync receives an unexpected number of source paths.","commonSituations":"See trigger scenarios.","solutions":["Provide the correct number of source paths expected by the sync operation.","Check the command-line parsing and source listing file."],"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-23T01:17:44.959Z"}