{"record":{"id":"1ba8f1e54d54e500","repo":"apache/hadoop","slug":"illegal-du-output","errorCode":null,"errorMessage":"Illegal du output","messagePattern":"Illegal du output","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DU.java","lineNumber":83,"sourceCode":"    public String toString() {\n      return\n          \"du -sk \" + getDirPath() + \"\\n\" + used.get() + \"\\t\" + getDirPath();\n    }\n\n    @Override\n    protected String[] getExecString() {\n      return new String[]{\"du\", \"-sk\", getDirPath()};\n    }\n\n    @Override\n    protected void parseExecResult(BufferedReader lines) throws IOException {\n      String line = lines.readLine();\n      if (line == null) {\n        throw new IOException(\"Expecting a line not the end of stream\");\n      }\n      String[] tokens = line.split(\"\\t\");\n      if (tokens.length == 0) {\n        throw new IOException(\"Illegal du output\");\n      }\n      setUsed(Long.parseLong(tokens[0]) * 1024);\n    }\n\n  }\n\n\n  public static void main(String[] args) throws Exception {\n    String path = \".\";\n    if (args.length > 0) {\n      path = args[0];\n    }\n\n    GetSpaceUsed du = new GetSpaceUsed.Builder().setPath(new File(path))\n                                                .setConf(new Configuration())\n                                                .build();\n    String duResult = du.toString();\n    System.out.println(duResult);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DU.java#L65-L101","documentation":"Error \"Illegal du output\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DU.java:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the du output format matches the expected '<size> <path>' two-column layout.","Check for localized or platform-specific du output differences and parse accordingly.","Verify the du command used is compatible with this platform."],"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"}