apache/hadoop · critical · RuntimeException

Unable to create the Decommission monitor from {cls}

Error message

Unable to create the Decommission monitor from {cls}

What it means

Thrown by DatanodeAdminManager.activate when reflection cannot instantiate the decommission monitor: conf.getClass for dfs.namenode.decommission.monitor.class (default DatanodeAdminMonitorImpl) fails, the class cannot be cast to DatanodeAdminMonitorInterface, or newInstance throws. The NameNode wraps any failure in a RuntimeException at startup, so a bad class name or a constructor error aborts NN activation of decommissioning machinery.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminManager.java:123

        DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_KEY,
        DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_DEFAULT,
        TimeUnit.SECONDS);
    Preconditions.checkArgument(intervalSecs >= 0, "Cannot set a negative " +
        "value for " + DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_KEY);

    Class cls = null;
    try {
      cls = conf.getClass(
          DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_MONITOR_CLASS,
          Class.forName(DFSConfigKeys
                  .DFS_NAMENODE_DECOMMISSION_MONITOR_CLASS_DEFAULT));
      monitor =
          (DatanodeAdminMonitorInterface)ReflectionUtils.newInstance(cls, conf);
      monitor.setBlockManager(blockManager);
      monitor.setNameSystem(namesystem);
      monitor.setDatanodeAdminManager(this);
    } catch (Exception e) {
      throw new RuntimeException("Unable to create the Decommission monitor " +
          "from "+cls, e);
    }
    executor.scheduleWithFixedDelay(monitor, intervalSecs, intervalSecs,
        TimeUnit.SECONDS);

    LOG.debug("Activating DatanodeAdminManager with interval {} seconds.", intervalSecs);
  }

  /**
   * Stop the admin monitor thread, waiting briefly for it to terminate.
   */
  void close() {
    executor.shutdownNow();
    try {
      executor.awaitTermination(3000, TimeUnit.MILLISECONDS);
    } catch (InterruptedException e) {}
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Remove or correct dfs.namenode.decommission.monitor.class so it names a class implementing DatanodeAdminMonitorInterface on the NN classpath
  2. If using the built-in monitor, unset the key to fall back to the default DatanodeAdminMonitorImpl
  3. Verify the custom monitor's constructor accepts (Configuration) via ReflectionUtils and does not throw on current config
  4. Deploy the custom jar to all NN classpaths and restart; check the caused-by chain in the NN log for the real failure

Example fix

<!-- before: typo/custom class fails to load -->
<property><name>dfs.namenode.decommission.monitor.class</name>
  <value>com.myco.DecomMonitorImp1</value></property> <!-- typo, RuntimeException at NN start -->

<!-- after: use built-in default (remove key) or correct class -->
<!-- delete the property, or: -->
<property><name>dfs.namenode.decommission.monitor.class</name>
  <value>org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorImpl</value></property>
Defensive patterns

Strategy: validation

Validate before calling

// Validate before relying on custom decommission monitor
String cls = conf.get("dfs.namenode.decommission.monitor.class",
    "org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorImpl");
Class<?> c = Class.forName(cls);
if (!DatanodeAdminMonitorInterface.class.isAssignableFrom(c)) {
  throw new IllegalArgumentException(cls + " must implement DatanodeAdminMonitorInterface");
}

Prevention

When it happens

Trigger: Setting dfs.namenode.decommission.monitor.class to a misspelled/full-path-wrong class, a custom monitor that does not implement DatanodeAdminMonitorInterface, a custom class not on the NN classpath, or whose constructor throws on the given Configuration.

Common situations: Custom/deployment-specific decommission monitors; typo in advanced config; class packaging moved across Hadoop versions; dropping a jar into NN classpath incorrectly.

Related errors


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