{"record":{"id":"d1e82d537f0563d1","repo":"apache/hadoop","slug":"cannot-run-listcorruptfileblocks-because-replicati","errorCode":null,"errorMessage":"Cannot run listCorruptFileBlocks because replication queues have not been initialized.","messagePattern":"Cannot run listCorruptFileBlocks because replication queues have not been initialized\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java","lineNumber":6331,"sourceCode":"        new ArrayList<CorruptFileBlockInfo>();\n    if (cookieTab == null) {\n      cookieTab = new String[] { null };\n    }\n\n    // Do a quick check if there are any corrupt files without taking the lock\n    if (blockManager.getMissingBlocksCount() == 0) {\n      if (cookieTab[0] == null) {\n        cookieTab[0] = String.valueOf(getIntCookie(cookieTab[0]));\n      }\n      LOG.debug(\"there are no corrupt file blocks.\");\n      return corruptFiles;\n    }\n\n    readLock(RwLockMode.GLOBAL);\n    try {\n      checkOperation(OperationCategory.READ);\n      if (!blockManager.isPopulatingReplQueues()) {\n        throw new IOException(\"Cannot run listCorruptFileBlocks because \" +\n                              \"replication queues have not been initialized.\");\n      }\n      // print a limited # of corrupt files per call\n\n      final Iterator<BlockInfo> blkIterator =\n          blockManager.getCorruptReplicaBlockIterator();\n\n      int skip = getIntCookie(cookieTab[0]);\n      for (int i = 0; i < skip && blkIterator.hasNext(); i++) {\n        blkIterator.next();\n      }\n\n      while (blkIterator.hasNext()) {\n        BlockInfo blk = blkIterator.next();\n        final INodeFile inode = getBlockCollection(blk);\n        skip++;\n        if (inode != null) {\n          String src = inode.getFullPathName();","sourceCodeStart":6313,"sourceCodeEnd":6349,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L6313-L6349","documentation":"Error \"Cannot run listCorruptFileBlocks because replication queues have not been initialized.\" thrown in apache/hadoop.","triggerScenarios":"An administrator or client invokes listCorruptFileBlocks/fsck while the NameNode is still starting up or in safemode.","commonSituations":"Running hdfs fsck immediately after a NameNode (re)start, before block manager initialization completes.","solutions":["Start or restart the NameNode and wait until it has fully exited safemode and initialized replication queues before running listCorruptFileBlocks (hdfs fsck -list-corruptfileblocks)."],"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"}