{"record":{"id":"cdffd7f236c6b482","repo":"apache/hadoop","slug":"failed-to-mkdirs-cdffd7","errorCode":null,"errorMessage":"Failed to mkdirs {}","messagePattern":"Failed to mkdirs (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java","lineNumber":163,"sourceCode":"   * @param bpDir directory corresponding to the BlockPool\n   * @param conf configuration\n   * @param timer include methods for getting time\n   * @throws IOException\n   */\n  BlockPoolSlice(String bpid, FsVolumeImpl volume, File bpDir,\n      Configuration conf, Timer timer) throws IOException {\n    this.config = conf;\n    this.bpDir = bpDir;\n    this.bpid = bpid;\n    this.volume = volume;\n    this.fileIoProvider = volume.getFileIoProvider();\n    this.currentDir = new File(bpDir, DataStorage.STORAGE_DIR_CURRENT);\n    this.finalizedDir = new File(\n        currentDir, DataStorage.STORAGE_DIR_FINALIZED);\n    this.lazypersistDir = new File(currentDir, DataStorage.STORAGE_DIR_LAZY_PERSIST);\n    if (!this.finalizedDir.exists()) {\n      if (!this.finalizedDir.mkdirs()) {\n        throw new IOException(\"Failed to mkdirs \" + this.finalizedDir);\n      }\n    }\n\n    this.ioFileBufferSize = DFSUtilClient.getIoFileBufferSize(conf);\n\n    this.deleteDuplicateReplicas = conf.getBoolean(\n        DFSConfigKeys.DFS_DATANODE_DUPLICATE_REPLICA_DELETION,\n        DFSConfigKeys.DFS_DATANODE_DUPLICATE_REPLICA_DELETION_DEFAULT);\n\n    this.cachedDfsUsedCheckTime =\n        conf.getLong(\n            DFSConfigKeys.DFS_DN_CACHED_DFSUSED_CHECK_INTERVAL_MS,\n            DFSConfigKeys.DFS_DN_CACHED_DFSUSED_CHECK_INTERVAL_DEFAULT_MS);\n\n    this.maxDataLength = conf.getInt(\n        CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,\n        CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT);\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java#L145-L181","documentation":"Error \"Failed to mkdirs {}\" thrown in apache/hadoop.","triggerScenarios":"Block pool slice initialization when mkdirs for the block pool directory fails, usually due to permissions or a bad disk on the storage volume.","commonSituations":"See trigger scenarios.","solutions":["Check that the parent directory of the block pool slice path exists and that the DataNode user has write permission on it.","Verify the volume is mounted and not read-only; remount or replace the disk if it failed.","Fix SELinux/AppArmor denials if the mkdir is blocked by a security policy."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}