{"record":{"id":"3beeabe083aceae9","repo":"apache/hadoop","slug":"all-directories-in-dfs-datanode-data-dir-are-inval","errorCode":null,"errorMessage":"All directories in dfs.datanode.data.dir are invalid: {}","messagePattern":"All directories in dfs\\.datanode\\.data\\.dir are invalid: (.+?)","errorType":"exception","errorClass":"DiskErrorException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/StorageLocationChecker.java","lineNumber":239,"sourceCode":"      if (dataDirs.size() == failedLocations.size()) {\n        throw new DiskErrorException(\"Too many failed volumes - \"\n            + \"current valid volumes: \" + goodLocations.size()\n            + \", volumes configured: \" + dataDirs.size()\n            + \", volumes failed: \" + failedLocations.size()\n            + \", volume failures tolerated: \" + maxVolumeFailuresTolerated);\n      }\n    } else {\n      if (failedLocations.size() > maxVolumeFailuresTolerated) {\n        throw new DiskErrorException(\"Too many failed volumes - \"\n            + \"current valid volumes: \" + goodLocations.size()\n            + \", volumes configured: \" + dataDirs.size()\n            + \", volumes failed: \" + failedLocations.size()\n            + \", volume failures tolerated: \" + maxVolumeFailuresTolerated);\n      }\n    }\n\n    if (goodLocations.size() == 0) {\n      throw new DiskErrorException(\"All directories in \"\n          + DFS_DATANODE_DATA_DIR_KEY + \" are invalid: \"\n          + failedLocations);\n    }\n\n    return new ArrayList<>(goodLocations.keySet());\n  }\n\n  public void shutdownAndWait(int gracePeriod, TimeUnit timeUnit) {\n    try {\n      delegateChecker.shutdownAndWait(gracePeriod, timeUnit);\n    } catch (InterruptedException e) {\n      LOG.warn(\"StorageLocationChecker interrupted during shutdown.\");\n      Thread.currentThread().interrupt();\n    }\n  }\n}\n","sourceCodeStart":221,"sourceCodeEnd":256,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/StorageLocationChecker.java#L221-L256","documentation":"Raised by StorageLocationChecker.check when health checking ended with zero good locations and the configuration deems that fatal (all configured datanode data directories failed their disk checks), so no storage can serve blocks.","triggerScenarios":"DataNode startup when every directory listed in dfs.datanode.data.dir is unreadable or failed. Avoid by ensuring at least one configured data directory is on a healthy, writable disk.","commonSituations":"See trigger scenarios.","solutions":["Verify every directory listed in dfs.datanode.data.dir exists, is mounted, and is writable by the DataNode user.","Check dmesg and smartctl for disk failures; replace failed disks and restore the mount points.","Correct wrong paths or bad [storage-type] tags in dfs.datanode.data.dir in hdfs-site.xml, then restart the DataNode."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}