apache/hadoop · error · FileNotFoundException

File {} not found.

Error message

File {} not found.

What it means

Error "File {} not found." thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java:322

            host.substring(0, idx), Integer.parseInt(host.substring(idx + 1)));
        }

        if (excludeNode != null) {
          excludes.add(excludeNode);
        } else {
          LOG.debug("DataNode {} was requested to be excluded, "
                + "but it was not found.", host);
        }
      }
    }

    // For these operations choose a datanode containing a replica
    if (op == GetOpParam.Op.OPEN
        || op == GetOpParam.Op.GETFILECHECKSUM
        || op == PostOpParam.Op.APPEND) {
      final NamenodeProtocols np = getRPCServer(namenode);
      if (status == null) {
        throw new FileNotFoundException("File " + path + " not found.");
      }

      final long len = status.getLen();
      if (op == GetOpParam.Op.OPEN) {
        if (openOffset < 0L || (openOffset >= len && len > 0)) {
          throw new IOException("Offset=" + openOffset
              + " out of the range [0, " + len + "); " + op + ", path=" + path);
        }
      }

      if (len > 0) {
        final long offset = op == GetOpParam.Op.OPEN? openOffset: len - 1;
        final LocatedBlocks locations = np.getBlockLocations(path, offset, 1);
        final int count = locations.locatedBlockCount();
        if (count > 0) {
          return bestNode(locations.get(0).getLocations(), excludes);
        } else {
          throw new IOException("Block could not be located. Path=" + path + ", offset=" + offset);

View on GitHub (pinned to 2add963021)

Solutions

  1. Verify the file path exists (check spelling and parent directories) before the WebHDFS open/read operation.

When it happens

Trigger: A WebHDFS read/open targets a path that does not exist.

Common situations: Reading a file that was deleted or never created, or a URL path typo.


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