{"record":{"id":"a5579ee68ff5edf1","repo":"apache/hadoop","slug":"pathname-from-is-not-a-valid-dfs-filename","errorCode":null,"errorMessage":"Pathname from is not a valid DFS filename.","messagePattern":"Pathname from is not a valid DFS filename\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java","lineNumber":265,"sourceCode":"   * @return object of DFSHedgedReadMetrics\n   */\n  public DFSHedgedReadMetrics getHedgedReadMetrics() {\n    return dfs.getHedgedReadMetrics();\n  }\n\n  /**\n   * Checks that the passed URI belongs to this filesystem and returns\n   * just the path component. Expects a URI with an absolute path.\n   *\n   * @param file URI with absolute path\n   * @return path component of {file}\n   * @throws IllegalArgumentException if URI does not belong to this DFS\n   */\n  String getPathName(Path file) {\n    checkPath(file);\n    String result = file.toUri().getPath();\n    if (!DFSUtilClient.isValidName(result)) {\n      throw new IllegalArgumentException(\"Pathname \" + result + \" from \" +\n          file+\" is not a valid DFS filename.\");\n    }\n    return result;\n  }\n\n  @Override\n  public BlockLocation[] getFileBlockLocations(FileStatus file, long start,\n      long len) throws IOException {\n    if (file == null) {\n      return null;\n    }\n    return getFileBlockLocations(file.getPath(), start, len);\n  }\n\n  /**\n   * The returned BlockLocation will have different formats for replicated\n   * and erasure coded file.\n   * Please refer to","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L247-L283","documentation":"Error \"Pathname from is not a valid DFS filename.\" thrown in apache/hadoop.","triggerScenarios":"A rename or similar operation is given a source pathname that is not a valid DFS filename, so the operation is rejected client-side.","commonSituations":"See trigger scenarios.","solutions":["Ensure the 'from' pathname is a valid DFS filename (absolute path, no scheme mismatch).","Check for typos or unsupported characters in the source path before rename."],"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"}