{"record":{"id":"a5759e3af79004c2","repo":"apache/hadoop","slug":"invalid-node-a5759e","errorCode":"INVALID_NODE","errorMessage":"The number of input nodes is 0. Please input the valid nodes.","messagePattern":"The number of input nodes is 0\\. Please input the valid nodes\\.","errorType":"validation","errorClass":"DiskBalancerException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/QueryCommand.java","lineNumber":77,"sourceCode":"        \"Prints verbose results.\");\n  }\n\n  /**\n   * Executes the Client Calls.\n   *\n   * @param cmd - CommandLine\n   */\n  @Override\n  public void execute(CommandLine cmd) throws Exception {\n    LOG.info(\"Executing \\\"query plan\\\" command.\");\n    TextStringBuilder result = new TextStringBuilder();\n    Preconditions.checkState(cmd.hasOption(DiskBalancerCLI.QUERY));\n    verifyCommandOptions(DiskBalancerCLI.QUERY, cmd);\n    String nodeVal = cmd.getOptionValue(DiskBalancerCLI.QUERY);\n    if (StringUtils.isBlank(nodeVal)) {\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    nodeVal = nodeVal.trim();\n    Set<String> resultSet = new TreeSet<>();\n    String[] nodes = nodeVal.split(\",\");\n    Collections.addAll(resultSet, nodes);\n    String outputLine = String.format(\n        \"Get current status of the diskbalancer for DataNode(s). \"\n            + \"These DataNode(s) are parsed from '%s'.\", nodeVal);\n    recordOutput(result, outputLine);\n    for (String nodeName : resultSet) {\n      // if the string is not name:port format use the default port.\n      String nodeAddress = nodeName;\n      if (!nodeName.matches(\"[^\\\\:]+:[0-9]{2,5}\")) {\n        int defaultIPC = NetUtils.createSocketAddr(\n            getConf().getTrimmed(DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_KEY,\n                DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_DEFAULT)).getPort();\n        nodeAddress = nodeName + \":\" + defaultIPC;","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/diskbalancer/command/QueryCommand.java#L59-L95","documentation":"Error \"The number of input nodes is 0. Please input the valid nodes.\" thrown in apache/hadoop.","triggerScenarios":"DiskBalancer query command when the node list resolves to zero nodes.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one valid node to the query command, or query all nodes by default.","Check the input node list or host file content."],"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"}