{"record":{"id":"b7cd90ba09458aa8","repo":"apache/hadoop","slug":"setsafemode","errorCode":null,"errorMessage":"setSafeMode","messagePattern":"setSafeMode","errorType":"exception","errorClass":"UnsupportedActionException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java","lineNumber":237,"sourceCode":"    if(checkpointManager != null) {\n      checkpointManager.interrupt();\n      checkpointManager = null;\n    }\n\n    // Abort current log segment - otherwise the NN shutdown code\n    // will close it gracefully, which is incorrect.\n    if (namesystem != null) {\n      getFSImage().getEditLog().abortCurrentLogSegment();\n    }\n\n    // Stop name-node threads\n    super.stop();\n  }\n  \n  /* @Override */// NameNode\n  public boolean setSafeMode(SafeModeAction action)\n      throws IOException {\n    throw new UnsupportedActionException(\"setSafeMode\");\n  }\n  \n  static class BackupNodeRpcServer extends NameNodeRpcServer implements\n      JournalProtocol {\n    private BackupNodeRpcServer(Configuration conf, BackupNode nn)\n        throws IOException {\n      super(conf, nn);\n      JournalProtocolServerSideTranslatorPB journalProtocolTranslator = \n          new JournalProtocolServerSideTranslatorPB(this);\n      BlockingService service = JournalProtocolService\n          .newReflectiveBlockingService(journalProtocolTranslator);\n      DFSUtil.addInternalPBProtocol(conf, JournalProtocolPB.class, service,\n          this.clientRpcServer);\n    }\n    \n    /** \n     * Verifies a journal request\n     */","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/BackupNode.java#L219-L255","documentation":"Error \"setSafeMode\" thrown in apache/hadoop.","triggerScenarios":"RPC to set safe mode directed at a BackupNode, which does not support the setSafeMode operation.","commonSituations":"See trigger scenarios.","solutions":["Do not call setSafeMode on a BackupNode; run safemode operations against the active NameNode."],"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-22T20:17:22.307Z"}