{"record":{"id":"0cea6176f57aeea6","repo":"apache/hadoop","slug":"may-not-pass-both-geteditsize-and-checkpoint","errorCode":null,"errorMessage":"May not pass both geteditsize and checkpoint","messagePattern":"May not pass both geteditsize and checkpoint","errorType":"validation","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java","lineNumber":838,"sourceCode":"\n    public boolean shouldPrintHelp() {\n      return shouldPrintHelp;\n    }\n    \n    public void parse(String ... argv) throws ParseException {\n      CommandLineParser parser = new PosixParser();\n      CommandLine cmdLine = parser.parse(options, argv);\n      \n      if (cmdLine.hasOption(helpOpt.getOpt())\n          || cmdLine.hasOption(helpOpt.getLongOpt())) {\n        shouldPrintHelp = true;\n        return;\n      }\n      \n      boolean hasGetEdit = cmdLine.hasOption(geteditsizeOpt.getOpt());\n      boolean hasCheckpoint = cmdLine.hasOption(checkpointOpt.getOpt()); \n      if (hasGetEdit && hasCheckpoint) {\n        throw new ParseException(\"May not pass both \"\n            + geteditsizeOpt.getOpt() + \" and \"\n            + checkpointOpt.getOpt());\n      }\n      \n      if (hasGetEdit) {\n        cmd = Command.GETEDITSIZE;\n      } else if (hasCheckpoint) {\n        cmd = Command.CHECKPOINT;\n        \n        String arg = cmdLine.getOptionValue(checkpointOpt.getOpt());\n        if (\"force\".equals(arg)) {\n          shouldForce = true;\n        } else if (arg != null) {\n          throw new ParseException(\"-checkpoint may only take 'force' as an \"\n              + \"argument\");\n        }\n      }\n      ","sourceCodeStart":820,"sourceCodeEnd":856,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L820-L856","documentation":"Error \"May not pass both geteditsize and checkpoint\" thrown in apache/hadoop.","triggerScenarios":"The SecondaryNameNode command line includes mutually exclusive options.","commonSituations":"Running 'hdfs secondarynamenode -checkpoint -geteditsize' together.","solutions":["Choose only one action: run the SecondaryNameNode with either -checkpoint or -geteditsize, not both."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}