{"record":{"id":"ca75a1b92ca674a5","repo":"apache/hadoop","slug":"invalid-value-configured-for-dfs-datanode-failed-v","errorCode":null,"errorMessage":"Invalid value configured for dfs.datanode.failed.volumes.tolerated - {volFailuresTolerated}. Value configured is either less than -1 or >= to the number of configured volumes ({volsConfigured}).","messagePattern":"Invalid value configured for dfs\\.datanode\\.failed\\.volumes\\.tolerated - (.+?)\\. Value configured is either less than -1 or >= to the number of configured volumes \\((.+?)\\)\\.","errorType":"validation","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":1925,"sourceCode":"        if (dnConf.maxLockedMemory > ulimit) {\n          throw new RuntimeException(String.format(\n            \"Cannot start datanode because the configured max locked memory\" +\n            \" size (%s) of %d bytes is more than the datanode's available\" +\n            \" RLIMIT_MEMLOCK ulimit of %d bytes.\",\n            DFS_DATANODE_MAX_LOCKED_MEMORY_KEY,\n            dnConf.maxLockedMemory,\n            ulimit));\n        }\n      }\n    }\n    LOG.info(\"Starting DataNode with maxLockedMemory = {}\",\n        dnConf.maxLockedMemory);\n\n    int volFailuresTolerated = dnConf.getVolFailuresTolerated();\n    int volsConfigured = dnConf.getVolsConfigured();\n    if (volFailuresTolerated < MAX_VOLUME_FAILURE_TOLERATED_LIMIT\n        || volFailuresTolerated >= volsConfigured) {\n      throw new HadoopIllegalArgumentException(\"Invalid value configured for \"\n          + \"dfs.datanode.failed.volumes.tolerated - \" + volFailuresTolerated\n          + \". Value configured is either less than -1 or >= \"\n          + \"to the number of configured volumes (\" + volsConfigured + \").\");\n    }\n\n    storage = new DataStorage();\n    \n    // global DN settings\n    registerMXBean();\n    initDataXceiver();\n    startInfoServer();\n    pauseMonitor = new JvmPauseMonitor();\n    pauseMonitor.init(getConf());\n    pauseMonitor.start();\n  \n    // BlockPoolTokenSecretManager is required to create ipc server.\n    this.blockPoolTokenSecretManager = new BlockPoolTokenSecretManager();\n","sourceCodeStart":1907,"sourceCodeEnd":1943,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L1907-L1943","documentation":"startDataNode validates dfs.datanode.failed.volumes.tolerated against the configured dir count: the value must be >= MAX_VOLUME_FAILURE_TOLERATED_LIMIT (-1) and strictly less than volsConfigured; anything else throws HadoopIllegalArgumentException and the DN exits. The message shows both the tolerated value and the configured volume count so the bad combination is obvious.","triggerScenarios":"A single-volume DataNode with tolerated >= 1 (template defaults like 2 fail: 2 >= 1 dir); values < -1 such as -2; shrinking dfs.datanode.data.dir from 6 dirs to 1 without lowering the tolerated count; tolerated exactly equal to the number of dirs.","commonSituations":"Test or lab nodes with one disk inheriting production defaults; automation that scales down dir counts but not the tolerated count; fresh installs copying a big-cluster hdfs-site.xml.","solutions":["Set dfs.datanode.failed.volumes.tolerated within [-1, #dirs - 1]; on a 1-dir node use 0","Express the setting in templates as a function of the dir list length instead of a constant","Correct hdfs-site.xml and restart the DataNode"],"exampleFix":"<!-- before: single volume, tolerated=2 copied from a 6-disk node -->\n<property><name>dfs.datanode.failed.volumes.tolerated</name><value>2</value></property>\n<!-- after -->\n<property><name>dfs.datanode.failed.volumes.tolerated</name><value>0</value></property>","handlingStrategy":"validation","validationCode":"int tolerated = conf.getInt(DFS_DATANODE_FAILED_VOLUMES_KEY, 0);\nint dirs = DataNode.getStorageLocations(conf).size();\nif (tolerated < -1 || tolerated >= dirs) {\n  throw new IllegalArgumentException(\"failed.volumes.tolerated must be in [-1, \" + (dirs - 1)\n      + \"] for \" + dirs + \" configured dirs\");\n}","typeGuard":null,"tryCatchPattern":"catch (HadoopIllegalArgumentException e) {\n  // message shows tolerated vs configured counts; fix hdfs-site.xml and restart the DN\n}","preventionTips":["Compute the tolerated value from the dir list length in config templates","Revalidate after any change to dfs.datanode.data.dir","On single-disk nodes the only valid values are -1 and 0"],"tags":["hadoop","hdfs","datanode","configuration","volume-management","startup"],"backgroundTag":"invalid-config-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}