{"record":{"id":"b5c485425d797e63","repo":"apache/hadoop","slug":"failed-to-find-datanode-suggest-to-check-cluster","errorCode":null,"errorMessage":"Failed to find datanode, suggest to check cluster health. excludeDatanodes={}","messagePattern":"Failed to find datanode, suggest to check cluster health\\. excludeDatanodes=(.+?)","errorType":"http","errorClass":"IOException","httpStatus":403,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java","lineNumber":429,"sourceCode":"      final UserParam username, final DoAsParam doAsUser,\n      final String path, final HttpOpParam.Op op, final long openOffset,\n      final long blocksize, final String excludeDatanodes,\n      final Param<?, ?>... parameters) throws URISyntaxException, IOException {\n    if (!DFSUtil.isValidName(path)) {\n      throw new InvalidPathException(path);\n    }\n    final DatanodeInfo dn;\n    final NamenodeProtocols np = getRPCServer(namenode);\n    HdfsFileStatus status = null;\n    if (op == GetOpParam.Op.OPEN\n        || op == GetOpParam.Op.GETFILECHECKSUM\n        || op == PostOpParam.Op.APPEND) {\n      status = np.getFileInfo(path);\n    }\n    dn = chooseDatanode(namenode, path, op, openOffset, blocksize,\n        excludeDatanodes, remoteAddr, status);\n    if (dn == null) {\n      throw new IOException(\"Failed to find datanode, suggest to check cluster\"\n          + \" health. excludeDatanodes=\" + excludeDatanodes);\n    }\n\n    final String delegationQuery;\n    if (!UserGroupInformation.isSecurityEnabled()) {\n      //security disabled\n      delegationQuery = Param.toSortedString(\"&\", doAsUser, username);\n    } else if (delegation.getValue() != null) {\n      //client has provided a token\n      delegationQuery = \"&\" + delegation;\n    } else {\n      //generate a token\n      final Token<? extends TokenIdentifier> t = generateDelegationToken(\n          ugi, null);\n      delegationQuery = \"&\" + new DelegationParam(t.encodeToUrlString());\n    }\n\n    StringBuilder queryBuilder = new StringBuilder();","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java#L411-L447","documentation":"Error \"Failed to find datanode, suggest to check cluster health. excludeDatanodes={}\" thrown in apache/hadoop.","triggerScenarios":"Thrown during WebHDFS block location lookup when no usable DataNode remains for the file after filtering excluded nodes, indicating dead DataNodes or an unhealthy cluster.","commonSituations":"See trigger scenarios.","solutions":["Check cluster health with 'hdfs dfsadmin -report' and bring failed DataNodes back online.","Review the excludeDatanodes list in the request and drop entries that are down or decommissioned so a valid DataNode can be chosen."],"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-23T01:17:44.959Z"}