{"record":{"id":"9b2874802b44ab1d","repo":"apache/hadoop","slug":"source-path-argpath-is-not-relative-to-parentpa","errorCode":null,"errorMessage":"Source path {argPath} is not relative to {parentPath}","messagePattern":"Source path (.+?) is not relative to (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java","lineNumber":883,"sourceCode":"        repl = Short.parseShort(commandLine.getOptionValue(REPLICATION));\n      }\n      // Remaining args\n      args = commandLine.getArgs();\n      List<Path> srcPaths = new ArrayList<Path>();\n      Path destPath = null;\n      //read the rest of the paths\n      for (int i = 0; i < args.length; i++) {\n        if (i == (args.length - 1)) {\n          destPath = new Path(args[i]);\n          if (!destPath.isAbsolute()) {\n            destPath = destPath.getFileSystem(getConf()).makeQualified(destPath);\n          }\n        }\n        else {\n          Path argPath = new Path(args[i]);\n          if (argPath.isAbsolute()) {\n            printUsage(options, false);\n            throw new IOException(\"Source path \" + argPath +\n                \" is not relative to \"+ parentPath);\n          }\n          srcPaths.add(new Path(parentPath, argPath));\n        }\n      }\n      if (destPath == null) {\n        printUsage(options, false);\n        throw new IOException(\"Destination path not specified.\");\n      }\n      if (srcPaths.size() == 0) {\n        // assuming if the user does not specify path for sources\n        // the whole parent directory needs to be archived. \n        srcPaths.add(parentPath);\n      }\n      // do a glob on the srcPaths and then pass it on\n      List<Path> globPaths = new ArrayList<Path>();\n      for (Path p: srcPaths) {\n        FileSystem fs = p.getFileSystem(getConf());","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java#L865-L901","documentation":"Error \"Source path {argPath} is not relative to {parentPath}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-archives/src/main/java/org/apache/hadoop/tools/HadoopArchives.java:883 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every source path is under the parent path given with -p; adjust the parent or the source paths."],"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"}