{"record":{"id":"5bad9baf3f25e861","repo":"apache/hadoop","slug":"invalid-host-file-path","errorCode":"INVALID_HOST_FILE_PATH","errorMessage":"The input host file path '%s' is not a valid path. Please make sure the host file exists.","messagePattern":"The input host file path '(.+?)' is not a valid path\\. Please make sure the host file exists\\.","errorType":"validation","errorClass":"DiskBalancerException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java","lineNumber":282,"sourceCode":"  protected Set<String> getNodeList(String listArg) throws IOException {\n    URL listURL;\n    String nodeData;\n    Set<String> resultSet = new TreeSet<>();\n\n    if ((listArg == null) || listArg.isEmpty()) {\n      return resultSet;\n    }\n\n    if (listArg.startsWith(\"file://\")) {\n      listURL = new URL(listArg);\n      try {\n        HostsFileReader.readFileToSet(\"include\",\n            Paths.get(listURL.getPath()).toString(), resultSet);\n      } catch (NoSuchFileException e) {\n        String warnMsg = String\n            .format(\"The input host file path '%s' is not a valid path. \"\n                + \"Please make sure the host file exists.\", listArg);\n        throw new DiskBalancerException(warnMsg,\n            DiskBalancerException.Result.INVALID_HOST_FILE_PATH);\n      }\n    } else {\n      nodeData = listArg;\n      String[] nodes = nodeData.split(\",\");\n\n      if (nodes.length == 0) {\n        String warnMsg = \"The number of input nodes is 0. \"\n            + \"Please input the valid nodes.\";\n        throw new DiskBalancerException(warnMsg,\n            DiskBalancerException.Result.INVALID_NODE);\n      }\n\n      Collections.addAll(resultSet, nodes);\n    }\n\n    return resultSet;\n  }","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/Command.java#L264-L300","documentation":"Error \"The input host file path '%s' is not a valid path. Please make sure the host file exists.\" thrown in apache/hadoop.","triggerScenarios":"DiskBalancer command with a host file path argument that does not exist or is not a regular file.","commonSituations":"See trigger scenarios.","solutions":["Verify the host file path exists and is readable; correct the path argument.","Create the host file with one node per line before running the diskbalancer command."],"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"}