{"record":{"id":"52889c90696c1eb6","repo":"stanfordnlp/CoreNLP","slug":"please-specify-input","errorCode":null,"errorMessage":"Please specify -input","messagePattern":"Please specify -input","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/neural/ConvertModels.java","lineNumber":390,"sourceCode":"  public static void main(String[] args) throws IOException, ClassNotFoundException, InstantiationException, NoSuchMethodException {\n    Properties props = StringUtils.argsToProperties(args);\n\n    final Stage stage;\n    try {\n      stage = Stage.valueOf(props.getProperty(\"stage\").toUpperCase(Locale.ROOT));\n    } catch (IllegalArgumentException | NullPointerException e) {\n      throw new IllegalArgumentException(\"Please specify -stage, either OLD or NEW\");\n    }\n\n    final Model modelType;\n    try {\n      modelType = Model.valueOf(props.getProperty(\"model\").toUpperCase(Locale.ROOT));\n    } catch (IllegalArgumentException | NullPointerException e) {\n      throw new IllegalArgumentException(\"Please specify -model, either SENTIMENT, DVPARSER, EMBEDDING, COREF, FASTCOREF\");\n    }\n\n    if (!props.containsKey(\"input\")) {\n      throw new IllegalArgumentException(\"Please specify -input\");\n    }\n\n    if (!props.containsKey(\"output\")) {\n      throw new IllegalArgumentException(\"Please specify -output\");\n    }\n\n    String inputPath = props.getProperty(\"input\");\n    String outputPath = props.getProperty(\"output\");\n\n    if (modelType == Model.SENTIMENT) {\n      if (stage == Stage.OLD) {\n        SentimentModel model = SentimentModel.loadSerialized(inputPath);\n        ObjectOutputStream out = IOUtils.writeStreamFromString(outputPath);\n        writeSentiment(model, out);\n        out.close();\n      } else {\n        ObjectInputStream in = IOUtils.readStreamFromString(inputPath);\n        SentimentModel model = readSentiment(in);","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/neural/ConvertModels.java#L372-L408","documentation":"A required-argument check in the ConvertModels command-line tool: the -input property (path to the source model to convert) was not supplied in the properties parsed from args, so conversion cannot proceed.","triggerScenarios":"Running the converter without -input on the command line, or misspelling the flag (e.g. -in, --input) so argsToProperties never sees an 'input' key.","commonSituations":"Scripted conversion pipelines where the flag was dropped during refactoring, or copying an example command and omitting the path.","solutions":["Add -input /path/to/source/model to the command","Fix the flag spelling so argsToProperties picks up 'input'","Verify the property key is exactly 'input' (no leading dashes in the properties map)"],"exampleFix":"// before\n... -stage NEW -model SENTIMENT -output out.gz\n// after\n... -stage NEW -model SENTIMENT -input models/sentiment.ser.gz -output out.gz","handlingStrategy":"validation","validationCode":"java.nio.file.Path in = java.nio.file.Path.of(inputArg);\nif (inputArg == null || !java.nio.file.Files.exists(in)) {\n  throw new IllegalArgumentException(\"-input must point to an existing model file\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  ConvertModels.main(args);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().equals(\"Please specify -input\")) {\n    System.err.println(\"Missing -input; usage: -input <modelPath> -output <modelPath>\");\n    System.exit(2);\n  }\n  throw e;\n}","preventionTips":["Always include -input in converter invocations","Check that shell quoting doesn't drop the argument","Validate arg presence in wrapper scripts before calling main"],"tags":["cli","configuration","model-conversion"],"backgroundTag":"missing-required-argument","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}