{"record":{"id":"1db095ff1bed98e3","repo":"apache/hadoop","slug":"unable-to-create-the-decommission-monitor-from-cl","errorCode":null,"errorMessage":"Unable to create the Decommission monitor from {cls}","messagePattern":"Unable to create the Decommission monitor from (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminManager.java","lineNumber":123,"sourceCode":"        DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_KEY,\n        DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_DEFAULT,\n        TimeUnit.SECONDS);\n    Preconditions.checkArgument(intervalSecs >= 0, \"Cannot set a negative \" +\n        \"value for \" + DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_INTERVAL_KEY);\n\n    Class cls = null;\n    try {\n      cls = conf.getClass(\n          DFSConfigKeys.DFS_NAMENODE_DECOMMISSION_MONITOR_CLASS,\n          Class.forName(DFSConfigKeys\n                  .DFS_NAMENODE_DECOMMISSION_MONITOR_CLASS_DEFAULT));\n      monitor =\n          (DatanodeAdminMonitorInterface)ReflectionUtils.newInstance(cls, conf);\n      monitor.setBlockManager(blockManager);\n      monitor.setNameSystem(namesystem);\n      monitor.setDatanodeAdminManager(this);\n    } catch (Exception e) {\n      throw new RuntimeException(\"Unable to create the Decommission monitor \" +\n          \"from \"+cls, e);\n    }\n    executor.scheduleWithFixedDelay(monitor, intervalSecs, intervalSecs,\n        TimeUnit.SECONDS);\n\n    LOG.debug(\"Activating DatanodeAdminManager with interval {} seconds.\", intervalSecs);\n  }\n\n  /**\n   * Stop the admin monitor thread, waiting briefly for it to terminate.\n   */\n  void close() {\n    executor.shutdownNow();\n    try {\n      executor.awaitTermination(3000, TimeUnit.MILLISECONDS);\n    } catch (InterruptedException e) {}\n  }\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeAdminManager.java#L105-L141","documentation":"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.","triggerScenarios":"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.","commonSituations":"Custom/deployment-specific decommission monitors; typo in advanced config; class packaging moved across Hadoop versions; dropping a jar into NN classpath incorrectly.","solutions":["Remove or correct dfs.namenode.decommission.monitor.class so it names a class implementing DatanodeAdminMonitorInterface on the NN classpath","If using the built-in monitor, unset the key to fall back to the default DatanodeAdminMonitorImpl","Verify the custom monitor's constructor accepts (Configuration) via ReflectionUtils and does not throw on current config","Deploy the custom jar to all NN classpaths and restart; check the caused-by chain in the NN log for the real failure"],"exampleFix":"<!-- before: typo/custom class fails to load -->\n<property><name>dfs.namenode.decommission.monitor.class</name>\n  <value>com.myco.DecomMonitorImp1</value></property> <!-- typo, RuntimeException at NN start -->\n\n<!-- after: use built-in default (remove key) or correct class -->\n<!-- delete the property, or: -->\n<property><name>dfs.namenode.decommission.monitor.class</name>\n  <value>org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorImpl</value></property>","handlingStrategy":"validation","validationCode":"// Validate before relying on custom decommission monitor\nString cls = conf.get(\"dfs.namenode.decommission.monitor.class\",\n    \"org.apache.hadoop.hdfs.server.blockmanagement.DatanodeAdminMonitorImpl\");\nClass<?> c = Class.forName(cls);\nif (!DatanodeAdminMonitorInterface.class.isAssignableFrom(c)) {\n  throw new IllegalArgumentException(cls + \" must implement DatanodeAdminMonitorInterface\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer the built-in monitor unless a custom one is required","Class-name configs: copy from a known-good source, avoid hand-typing FQCNs","Deploy custom monitor jars to every NN classpath and test NN startup in staging","Custom monitors must implement DatanodeAdminMonitorInterface and tolerate null blockManager during construction"],"tags":["hdfs","namenode-startup","decommission","configuration","reflection","classpath"],"backgroundTag":"invalid-configuration-class","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}