apache/hadoop · error · InvalidPathException

Working directory cannot be set to NULL

Error message

Working directory cannot be set to NULL

What it means

Argument guard in AdlFileSystem.setWorkingDirectory: a null Path was passed, which cannot become the base for resolving relative paths; rejected as InvalidPathException.

Solutions

  1. Pass a non-null Path to setWorkingDirectory().
  2. Fix caller code passing a null path.
Defensive patterns

Strategy: validation

When it happens

Trigger: setWorkingDirectory(null) is invoked on the ADL filesystem.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/8829a287ea66e6d0. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-tools/hadoop-azure-datalake/src/main/java/org/apache/hadoop/fs/adl/AdlFileSystem.java:877

   * Get the current working directory for the given file system.
   *
   * @return the directory pathname
   */
  @Override
  public Path getWorkingDirectory() {
    return workingDirectory;
  }

  /**
   * Set the current working directory for the given file system. All relative
   * paths will be resolved relative to it.
   *
   * @param dir Working directory path.
   */
  @Override
  public void setWorkingDirectory(final Path dir) {
    if (dir == null) {
      throw new InvalidPathException("Working directory cannot be set to NULL");
    }

    /**
     * Do not validate the scheme and URI of the passsed parameter. When Adls
     * runs as additional file system, working directory set has the default
     * file system scheme and uri.
     *
     * Found a problem during PIG execution in
     * https://github.com/apache/pig/blob/branch-0
     * .15/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer
     * /PigInputFormat.java#L235
     * However similar problem would be present in other application so
     * defaulting to build working directory using relative path only.
     */
    this.workingDirectory = this.makeAbsolute(dir);
  }

  /**

View on GitHub (pinned to 2add963021)