{"record":{"id":"32f3290321478636","repo":"apache/hadoop","slug":"illegal-arguments-list","errorCode":null,"errorMessage":"Illegal arguments list!","messagePattern":"Illegal arguments list!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/Anonymizer.java","lineNumber":77,"sourceCode":"  \n  private void initialize(String[] args) throws Exception {\n    try {\n      for (int i = 0; i < args.length; ++i) {\n        if (\"-trace\".equals(args[i])) {\n          anonymizeTrace = true;\n          inputTracePath = new Path(args[i+1]);\n          outputTracePath = new Path(args[i+2]);\n          i +=2;\n        }\n        if (\"-topology\".equals(args[i])) {\n          anonymizeTopology = true;\n          inputTopologyPath = new Path(args[i+1]);\n          outputTopologyPath = new Path(args[i+2]);\n          i +=2;\n        }\n      }\n    } catch (Exception e) {\n      throw new IllegalArgumentException(\"Illegal arguments list!\", e);\n    }\n    \n    if (!anonymizeTopology && !anonymizeTrace) {\n      throw new IllegalArgumentException(\"Invalid arguments list!\");\n    }\n    \n    statePool = new StatePool();\n    // initialize the state manager after the anonymizers are registered\n    statePool.initialize(getConf());\n     \n    outMapper = new ObjectMapper();\n    // define a module\n    SimpleModule module = new SimpleModule(\n        \"Anonymization Serializer\", new Version(0, 1, 1, \"FINAL\", \"\", \"\"));\n    // add various serializers to the module\n    // use the default (as-is) serializer for default data types\n    module.addSerializer(DataType.class, new DefaultRumenSerializer());\n    // use a blocking serializer for Strings as they can contain sensitive ","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/Anonymizer.java#L59-L95","documentation":"IllegalArgumentException('Illegal arguments list!') from Anonymizer's arg loop: ANY exception while scanning args (most commonly ArrayIndexOutOfBoundsException from '-trace' or '-topology' not being followed by two paths, NumberFormatException, or a bad Path) is caught and rethrown with this generic message and the original cause attached.","triggerScenarios":"Running the rumen Anonymizer with 'hadoop ... Anonymizer -trace' (missing input/output trace paths), '-topology' with fewer than two following path args, or any arg order that makes args[i+1]/args[i+2] fall off the array; also malformed URI paths that make new Path() throw.","commonSituations":"Shell scripts that drop quoted empty args; copy-paste command lines from docs of a different version; users assuming '-trace' takes one file instead of input+output pairs.","solutions":["Call getCause() on the exception (or log the full stack) — the chained cause shows the real failure such as ArrayIndexOutOfBoundsException","Fix the command to the exact form: -trace <inputTrace> <outputTrace> and/or -topology <inputTopology> <outputTopology>, each flag followed by exactly two paths","Verify both paths are valid, resolvable URIs (file:/ or hdfs:/ prefixes)","Add argument validation in your launcher script before invoking the tool"],"exampleFix":"# before (missing output trace path)\nhadoop jar rumen.jar org.apache.hadoop.tools.rumen.Anonymizer -trace /in/trace.json\n\n# after (input and output path pair)\nhadoop jar rumen.jar org.apache.hadoop.tools.rumen.Anonymizer -trace /in/trace.json /out/trace-anon.json","handlingStrategy":"validation","validationCode":"boolean validAnonymizerArgs(String[] a) {\n  for (int i = 0; i < a.length; i++) {\n    if (\"-trace\".equals(a[i]) || \"-topology\".equals(a[i])) {\n      if (i + 2 >= a.length) return false;        // needs two paths\n      // optionally: verify a[i+1], a[i+2] parse as URIs\n    }\n  }\n  return true;\n}","typeGuard":null,"tryCatchPattern":"try {\n  anonymizer.run(args);\n} catch (IllegalArgumentException e) {\n  Throwable cause = e.getCause(); // real reason: AIOOBE, bad Path, etc.\n  System.err.println(\"Bad Anonymizer args: \" + cause);\n}","preventionTips":["Always give each of -trace/-topology exactly two path arguments","Validate assembled command lines in scripts before execution","Log the full stack, not just the message, to see the chained cause"],"tags":["hadoop","rumen","anonymizer","cli-args","argument-parsing"],"backgroundTag":"invalid-command-line-arguments","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}