{"record":{"id":"b30227bced97e338","repo":"apache/hadoop","slug":"invalid-argument-b30227","errorCode":null,"errorMessage":"Invalid argument : {}","messagePattern":"Invalid argument : (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java","lineNumber":999,"sourceCode":"      if (parameters[i].equals(\"-nsQuota\")) {\n        i++;\n        try {\n          nsQuota = Long.parseLong(parameters[i]);\n        } catch (Exception e) {\n          throw new IllegalArgumentException(\n              \"Cannot parse nsQuota: \" + parameters[i]);\n        }\n      } else if (parameters[i].equals(\"-ssQuota\")) {\n        i++;\n        try {\n          ssQuota = StringUtils.TraditionalBinaryPrefix\n              .string2long(parameters[i]);\n        } catch (Exception e) {\n          throw new IllegalArgumentException(\n              \"Cannot parse ssQuota: \" + parameters[i]);\n        }\n      } else {\n        throw new IllegalArgumentException(\n            \"Invalid argument : \" + parameters[i]);\n      }\n\n      i++;\n    }\n\n    if (nsQuota <= 0 || ssQuota <= 0) {\n      throw new IllegalArgumentException(\n          \"Input quota value should be a positive number.\");\n    }\n\n    if (nsQuota == HdfsConstants.QUOTA_DONT_SET &&\n        ssQuota == HdfsConstants.QUOTA_DONT_SET) {\n      throw new IllegalArgumentException(\n          \"Must specify at least one of -nsQuota and -ssQuota.\");\n    }\n\n    return updateQuota(mount, nsQuota, ssQuota);","sourceCodeStart":981,"sourceCodeEnd":1017,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/tools/federation/RouterAdmin.java#L981-L1017","documentation":"dfsrouteradmin -setQuota walks every token after the mount path and accepts only the exact flags -nsQuota and -ssQuota (case-sensitive). Any other token reaches the else branch and throws 'Invalid argument : <token>'. This is pure client-side argument validation; no RPC is made.","triggerScenarios":"-setQuota /mount -nsquota 5 (lowercase flag); -setQuota /mount -storageType DISK 100 (that flag belongs to -setStorageTypeQuota); a duplicated mount path; a stray option such as -v or --help appended to the command.","commonSituations":"Flag spelling mistakes and wrong-case flags; using storage-type quota syntax with -setQuota; leftover arguments from copy-pasted runbooks; scripts appending logging flags the subcommand does not support.","solutions":["Use exactly -nsQuota and/or -ssQuota after the mount path, in that spelling","For per-storage-type quotas use: hdfs dfsrouteradmin -setStorageTypeQuota <path> -storageType <type> <quota>","Print the syntax first: hdfs dfsrouteradmin -help setQuota","Remove any extra tokens (second paths, generic flags) from the command line"],"exampleFix":"# before\nhdfs dfsrouteradmin -setQuota /mount -nsquota 100000\n# after\nhdfs dfsrouteradmin -setQuota /mount -nsQuota 100000","handlingStrategy":"validation","validationCode":"# whitelist tokens after the mount path\ncase \"$FLAG\" in\n  -nsQuota|-ssQuota) ;;\n  *) echo \"unsupported flag '$FLAG' for -setQuota\" >&2; exit 2;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Flags are case-sensitive: -nsQuota / -ssQuota exactly","Storage-type flags belong to -setStorageTypeQuota","Print 'hdfs dfsrouteradmin -help setQuota' when composing new runbooks"],"tags":["hdfs","rbf","federation","quota","cli","argument-validation"],"backgroundTag":"invalid-command-line-argument","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}