{"record":{"id":"5086b5147423ae41","repo":"stanfordnlp/CoreNLP","slug":"please-specify-output","errorCode":null,"errorMessage":"Please specify -output","messagePattern":"Please specify -output","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/neural/ConvertModels.java","lineNumber":394,"sourceCode":"    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);\n        in.close();\n        model.saveSerialized(outputPath);\n      }\n    } else if (modelType == Model.DVPARSER) {","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/neural/ConvertModels.java#L376-L412","documentation":"IllegalArgumentException from ConvertModels.main when the -model argument is absent or not one of SENTIMENT, DVPARSER, EMBEDDING, COREF, FASTCOREF, or when -input/-output paths are missing; these flags are mandatory for model conversion.","triggerScenarios":"Running the converter without -output, or misspelling the flag so the property key 'output' is missing.","commonSituations":"Omitting the destination when scripting batch conversions, or shell-quoting issues swallowing the argument.","solutions":["Add -output /path/to/destination/model to the command","Fix the flag spelling so argsToProperties sees 'output'","Quote paths containing spaces on the command line"],"exampleFix":"// before\n... -stage NEW -model SENTIMENT -input models/sentiment.ser.gz\n// after\n... -stage NEW -model SENTIMENT -input models/sentiment.ser.gz -output models/sentiment-new.ser.gz","handlingStrategy":"validation","validationCode":"if (outputArg == null || outputArg.isBlank()) {\n  throw new IllegalArgumentException(\"-output must be a non-empty path\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  ConvertModels.main(args);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().equals(\"Please specify -output\")) {\n    System.err.println(\"Missing -output; usage: -input <modelPath> -output <modelPath>\");\n    System.exit(2);\n  }\n  throw e;\n}","preventionTips":["Always include -output in converter invocations","Quote paths with spaces on the command line","Verify the output parent directory exists before conversion"],"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"}