{"record":{"id":"7ca4d240755ba747","repo":"apache/hadoop","slug":"illegal-option-t","errorCode":null,"errorMessage":"Illegal option -t","messagePattern":"Illegal option -t","errorType":"exception","errorClass":"CommandFormat.UnknownOptionException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java","lineNumber":56,"sourceCode":"    factory.addClass(Rename.class, \"-mv\");\n  }\n\n  /**\n   *  Move local files to a remote filesystem\n   */\n  public static class MoveFromLocal extends CopyFromLocal {\n    public static final String NAME = \"moveFromLocal\";\n    public static final String USAGE =\n        \"[-f] [-p] [-l] [-d] <localsrc> ... <dst>\";\n    public static final String DESCRIPTION = \n        \"Same as -put, except that the source is \" +\n        \"deleted after it's copied\\n\" +\n        \"and -t option has not yet implemented.\";\n\n    @Override\n    protected void processOptions(LinkedList<String> args) throws IOException {\n      if(args.contains(\"-t\")) {\n        throw new CommandFormat.UnknownOptionException(\"-t\");\n      }\n      super.processOptions(args);\n    }\n\n    @Override\n    protected void processPath(PathData src, PathData target) throws IOException {\n      // unlike copy, don't merge existing dirs during move\n      if (target.exists && target.stat.isDirectory()) {\n        throw new PathExistsException(target.toString());\n      }\n      super.processPath(src, target);\n    }\n    \n    @Override\n    protected void postProcessPath(PathData src) throws IOException {\n      if (!src.fs.delete(src.path, false)) {\n        // we have no way to know the actual error...\n        PathIOException e = new PathIOException(src.toString());","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java#L38-L74","documentation":"MoveFromLocal.processOptions (MoveCommands.java:56) explicitly rejects the -t (thread count) option even though the sibling 'put' command supports it. It throws CommandFormat.UnknownOptionException('-t'), rendered as 'Illegal option -t'. The command's own DESCRIPTION states '-t option has not yet implemented'.","triggerScenarios":"Running 'hadoop fs -moveFromLocal -t 4 localsrc dst' (any -t with or without a value). Copying a tuned '-put -t N' command line and swapping only the verb to -moveFromLocal.","commonSituations":"Scripts migrated from hdfs dfs -put -t <threads> for parallel uploads; version upgrades where -t was added to put (HADOOP-15880 era) and operators assumed parity; CI pipelines parameterizing thread counts across upload commands.","solutions":["Drop the -t option from the -moveFromLocal invocation (first and simplest fix)","Use 'hadoop fs -put -t <n> <src> <dst>' followed by deleting the local source if you need parallel threads","Parallelize externally: split the file list across multiple -moveFromLocal processes or use DistCp for bulk moves"],"exampleFix":"# before\nhadoop fs -moveFromLocal -t 4 bigfile.log /data/\n# -moveFromLocal: Illegal option -t\n\n# after\nhadoop fs -moveFromLocal bigfile.log /data/\n\n# or, if threads are required:\nhadoop fs -put -t 4 bigfile.log /data/ && rm bigfile.log","handlingStrategy":"validation","validationCode":"// in shell wrappers, whitelist flags per command\nif [[ \"$cmd\" == *moveFromLocal* && \"$args\" == *\" -t\"* ]]; then\n  echo \"-t unsupported for moveFromLocal; stripping\"; args=${args/ -t*/};\nfi","typeGuard":null,"tryCatchPattern":"catch (CommandFormat.UnknownOptionException e) { re-run without the -t flag or delegate to 'put -t' plus explicit source delete }","preventionTips":["Check a command's USAGE string (hadoop fs -moveFromLocal with no args prints supported flags) before scripting","Do not assume flag parity between put and moveFromLocal"],"tags":["movefromlocal","invalid-option","command-line","hadoop-shell","unsupported-flag"],"backgroundTag":"unsupported-command-option","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}