{"record":{"id":"14f87bc11452cfd3","repo":"apache/hadoop","slug":"invalid-dfs-directory-name","errorCode":null,"errorMessage":"Invalid DFS directory name ","messagePattern":"Invalid DFS directory name ","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":232,"sourceCode":"  public Path getWorkingDirectory() {\n    return workingDir;\n  }\n\n  @Override\n  public long getDefaultBlockSize() {\n    return dfs.getConf().getDefaultBlockSize();\n  }\n\n  @Override\n  public short getDefaultReplication() {\n    return dfs.getConf().getDefaultReplication();\n  }\n\n  @Override\n  public void setWorkingDirectory(Path dir) {\n    String result = fixRelativePart(dir).toUri().getPath();\n    if (!DFSUtilClient.isValidName(result)) {\n      throw new IllegalArgumentException(\"Invalid DFS directory name \" +\n          result);\n    }\n    workingDir = fixRelativePart(dir);\n  }\n\n  @Override\n  public Path getHomeDirectory() {\n    return makeQualified(\n        new Path(DFSUtilClient.getHomeDirectory(getConf(), dfs.ugi)));\n  }\n\n  /**\n   * Returns the hedged read metrics object for this client.\n   *\n   * @return object of DFSHedgedReadMetrics\n   */\n  public DFSHedgedReadMetrics getHedgedReadMetrics() {\n    return dfs.getHedgedReadMetrics();","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L214-L250","documentation":"Error \"Invalid DFS directory name \" thrown in apache/hadoop.","triggerScenarios":"An operation receives a path string that is not a valid DFS directory name (for example malformed or empty), and it is rejected before any NameNode call.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid absolute DFS path (starting with /) and without illegal characters.","Verify the path string before calling the FileSystem API; normalize or strip whitespace."],"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"}