{"record":{"id":"e0e4b727e2328092","repo":"apache/hadoop","slug":"for-enabling-or-disabling-storage-policy-satisfier","errorCode":null,"errorMessage":"For enabling or disabling storage policy satisfier, must pass either internal/external/none string value only","messagePattern":"For enabling or disabling storage policy satisfier, must pass either internal/external/none string value only","errorType":"exception","errorClass":"ReconfigurationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java","lineNumber":2580,"sourceCode":"          rpcServer.getServiceRpcServer().setLogSlowRPCThresholdTime(logSlowRPCThresholdTime);\n        }\n        if (rpcServer.getLifelineRpcServer() != null) {\n          rpcServer.getLifelineRpcServer().setLogSlowRPCThresholdTime(logSlowRPCThresholdTime);\n        }\n        result = Long.toString(logSlowRPCThresholdTime);\n      }\n      LOG.info(\"RECONFIGURE* changed reconfigureLogSlowRPC {} to {}\", property, result);\n      return result;\n    } catch (IllegalArgumentException e) {\n      throw new ReconfigurationException(property, newVal, getConf().get(property), e);\n    }\n  }\n\n  String reconfigureSPSModeEvent(String newVal, String property)\n      throws ReconfigurationException {\n    if (newVal == null\n        || StoragePolicySatisfierMode.fromString(newVal) == null) {\n      throw new ReconfigurationException(property, newVal,\n          getConf().get(property),\n          new HadoopIllegalArgumentException(\n              \"For enabling or disabling storage policy satisfier, must \"\n                  + \"pass either internal/external/none string value only\"));\n    }\n\n    if (!isActiveState()) {\n      throw new ReconfigurationException(property, newVal,\n          getConf().get(property),\n          new HadoopIllegalArgumentException(\n              \"Enabling or disabling storage policy satisfier service on \"\n                  + state + \" NameNode is not allowed\"));\n    }\n    StoragePolicySatisfierMode mode = StoragePolicySatisfierMode\n        .fromString(newVal);\n    if (mode == StoragePolicySatisfierMode.NONE) {\n      // disabling sps service\n      if (namesystem.getBlockManager().getSPSManager() != null) {","sourceCodeStart":2562,"sourceCodeEnd":2598,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java#L2562-L2598","documentation":"reconfigureSPSModeEvent validates the new value for dfs.storage.policy.satisfier.mode before touching state: if newVal is null (property removed) or StoragePolicySatisfierMode.fromString(newVal) returns null, it throws ReconfigurationException wrapping HadoopIllegalArgumentException with this message. Only the strings 'internal', 'external' and 'none' map to enum values, so anything else - including 'true', 'on', 'off', 'disabled' - is rejected.","triggerScenarios":"`hdfs dfsadmin -reconfig namenode <addr> -set dfs.storage.policy.satisfier.mode=<not internal/external/none>` - e.g. 'true', 'ON', an empty value, or removing the property (null).","commonSituations":"Operators try to toggle SPS like a boolean ('true'/'false') instead of selecting a mode; typos like 'externel'; attempting to clear the property to disable rather than setting 'none'.","solutions":["Set exactly one of the three modes: `-set dfs.storage.policy.satisfier.mode=external`","To disable SPS use 'none', not false/off/disabled","Check the currently configured mode first (`-reconfig namenode <addr> -properties` or hdfs-site.xml)","Remember the reconfig must target the ACTIVE NameNode - a separate state check (error 2968) rejects standbys"],"exampleFix":"# before\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.storage.policy.satisfier.mode=true\n\n# after - valid enum values only\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.storage.policy.satisfier.mode=external","handlingStrategy":"validation","validationCode":"case \"${MODE,,}\" in internal|external|none) ;; *) echo \"mode must be internal|external|none\"; exit 1;; esac\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.storage.policy.satisfier.mode=$MODE","typeGuard":"static boolean isValidSpsMode(String s) {\n  return StoragePolicySatisfierMode.fromString(s) != null; // internal|external|none\n}","tryCatchPattern":"catch (ReconfigurationException e) {\n  if (e.getCause() instanceof HadoopIllegalArgumentException) {\n    // invalid SPS mode string - surface allowed values internal/external/none\n  }\n}","preventionTips":["Treat dfs.storage.policy.satisfier.mode as an enum, never a boolean","Build the value with a case statement in automation so only the three literals can ship","Remember 'none' is the off state"],"tags":["hdfs","name-node","reconfig","storage-policy-satisfier","sps","dfsadmin","enum-value"],"backgroundTag":"runtime-reconfig-rejected","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}