apache/hadoop · error · DiskErrorException

${diskValidator} DiskValidator class not found.

Error message

${diskValidator} DiskValidator class not found.

What it means

DiskValidatorFactory.getInstance(name) accepts the built-in names 'basic' and 'read-write' case-insensitively; any other value is treated as a fully-qualified class name and loaded with Class.forName. A ClassNotFoundException becomes DiskErrorException('<name> DiskValidator class not found.'). The name comes from cluster config (e.g. yarn.nodemanager.disk-validator used by the NodeManager, LocalDirsHandlerService, DirectoryCollection and LocalDirAllocator).

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/DiskValidatorFactory.java:86

   * @param diskValidator canonical class name, for example, "basic"
   * @throws DiskErrorException if the class cannot be located
   * @return disk validator.
   */
  @SuppressWarnings("unchecked")
  public static DiskValidator getInstance(String diskValidator)
      throws DiskErrorException {
    @SuppressWarnings("rawtypes")
    Class clazz;

    if (diskValidator.equalsIgnoreCase(BasicDiskValidator.NAME)) {
      clazz = BasicDiskValidator.class;
    } else if (diskValidator.equalsIgnoreCase(ReadWriteDiskValidator.NAME)) {
      clazz = ReadWriteDiskValidator.class;
    } else {
      try {
        clazz = Class.forName(diskValidator);
      } catch (ClassNotFoundException cnfe) {
        throw new DiskErrorException(diskValidator
            + " DiskValidator class not found.", cnfe);
      }
    }

    return getInstance(clazz);
  }
}

View on GitHub (pinned to 2add963021)

Solutions

  1. Set the validator to a built-in name: 'basic' (permission checks only) or 'read-write' (probe I/O)
  2. For custom validators, use the exact fully-qualified class name and ship the jar where the daemon loads it (e.g. the Hadoop lib dir)
  3. Check for stray whitespace or spelling in the yarn.nodemanager.disk-validator value

Example fix

<!-- before -->
<property><name>yarn.nodemanager.disk-validator</name><value>readwrite</value></property>
<!-- after -->
<property><name>yarn.nodemanager.disk-validator</name><value>read-write</value></property>
Defensive patterns

Strategy: validation

Validate before calling

void validateDiskValidatorName(String name) throws DiskErrorException {
  if (name.equalsIgnoreCase("basic") || name.equalsIgnoreCase("read-write")) return;
  try {
    Class.forName(name); // must be a loadable DiskValidator implementation
  } catch (ClassNotFoundException e) {
    throw new DiskErrorException(name + " DiskValidator class not found.", e);
  }
}

Try / catch

catch (DiskErrorException e) {
  // validator name is neither built-in nor a class on the classpath
  log.error("bad disk validator config; falling back to 'basic'", e);
}

Prevention

When it happens

Trigger: A typo'd validator name that is neither basic/read-write nor a loadable class ('readwrite', 'rw', 'Basic ' with whitespace); a custom DiskValidator implementation whose class is not on the daemon classpath; a wrong fully-qualified class name.

Common situations: yarn.nodemanager.disk-validator misconfigured during cluster setup; custom validator jars shipped to some nodes only; copied config from another cluster referencing site-specific classes.

Related errors


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