{"record":{"id":"8829a287ea66e6d0","repo":"apache/hadoop","slug":"working-directory-cannot-be-set-to-null","errorCode":null,"errorMessage":"Working directory cannot be set to NULL","messagePattern":"Working directory cannot be set to NULL","errorType":"validation","errorClass":"InvalidPathException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure-datalake/src/main/java/org/apache/hadoop/fs/adl/AdlFileSystem.java","lineNumber":877,"sourceCode":"   * Get the current working directory for the given file system.\n   *\n   * @return the directory pathname\n   */\n  @Override\n  public Path getWorkingDirectory() {\n    return workingDirectory;\n  }\n\n  /**\n   * Set the current working directory for the given file system. All relative\n   * paths will be resolved relative to it.\n   *\n   * @param dir Working directory path.\n   */\n  @Override\n  public void setWorkingDirectory(final Path dir) {\n    if (dir == null) {\n      throw new InvalidPathException(\"Working directory cannot be set to NULL\");\n    }\n\n    /**\n     * Do not validate the scheme and URI of the passsed parameter. When Adls\n     * runs as additional file system, working directory set has the default\n     * file system scheme and uri.\n     *\n     * Found a problem during PIG execution in\n     * https://github.com/apache/pig/blob/branch-0\n     * .15/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer\n     * /PigInputFormat.java#L235\n     * However similar problem would be present in other application so\n     * defaulting to build working directory using relative path only.\n     */\n    this.workingDirectory = this.makeAbsolute(dir);\n  }\n\n  /**","sourceCodeStart":859,"sourceCodeEnd":895,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure-datalake/src/main/java/org/apache/hadoop/fs/adl/AdlFileSystem.java#L859-L895","documentation":"Error \"Working directory cannot be set to NULL\" thrown in apache/hadoop.","triggerScenarios":"setWorkingDirectory(null) is invoked on the ADL filesystem.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null Path to setWorkingDirectory().","Fix caller code passing a null path."],"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"}