{"record":{"id":"c40706685fd61088","repo":"apache/hadoop","slug":"could-not-change-property-from-to","errorCode":null,"errorMessage":"Could not change property {} from '{}' to '{}'","messagePattern":"Could not change property (.+?) from '(.+?)' to '(.+?)'","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":2769,"sourceCode":"        newSetting = String.valueOf(datanodeManager.getDatanodeAdminManager().getBlocksPerLock());\n      }\n      LOG.info(\"RECONFIGURE* changed reconfigureDecommissionBackoffMonitorParameters {} to {}\",\n          property, newSetting);\n      return newSetting;\n    } catch (IllegalArgumentException e) {\n      throw new ReconfigurationException(property, newVal, getConf().get(property), e);\n    }\n  }\n\n  private String reconfigureMinBlocksForWrite(String property, String newValue)\n      throws ReconfigurationException {\n    try {\n      int newSetting = adjustNewVal(\n          DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_DEFAULT, newValue);\n      namesystem.getBlockManager().setMinBlocksForWrite(newSetting);\n      return String.valueOf(newSetting);\n    } catch (IllegalArgumentException e) {\n      throw new ReconfigurationException(property, newValue, getConf().get(property), e);\n    }\n  }\n\n  private String reconfigureFSNamesystemLockMetricsParameters(final String property,\n      final String newVal) throws ReconfigurationException {\n    String result;\n    try {\n      switch (property) {\n      case DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY: {\n        if (newVal != null && !newVal.equalsIgnoreCase(\"true\") &&\n            !newVal.equalsIgnoreCase(\"false\")) {\n          throw new IllegalArgumentException(newVal + \" is not boolean value\");\n        }\n        boolean enable = (newVal == null ?\n            DFS_NAMENODE_LOCK_DETAILED_METRICS_DEFAULT : Boolean.parseBoolean(newVal));\n        result = Boolean.toString(enable);\n        namesystem.setMetricsEnabled(enable);\n        break;","sourceCodeStart":2751,"sourceCodeEnd":2787,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java#L2751-L2787","documentation":"reconfigureMinBlocksForWrite reconfigures dfs.namenode.blockplacementpolicy.min.blocks.for.write: adjustNewVal(DFS_NAMENODE_BLOCKPLACEMENTPOLICY_MIN_BLOCKS_FOR_WRITE_DEFAULT, newValue) falls back to the default for null or does Integer.parseInt, and BlockManager.setMinBlocksForWrite applies it. Any IllegalArgumentException (non-numeric input) is wrapped into ReconfigurationException(property, newValue, oldValue).","triggerScenarios":"`hdfs dfsadmin -reconfig namenode <addr> -set dfs.namenode.blockplacementpolicy.min.blocks.for.write=<non-integer>` - e.g. 'two', '2 blocks', '2.5'.","commonSituations":"Lowering min-blocks-for-write to allow writes on under-replicated clusters during node loss, with a malformed value; templated configs injecting blanks.","solutions":["Send a plain integer: `-set dfs.namenode.blockplacementpolicy.min.blocks.for.write=1`","Pre-check with a regex like ^[0-9]+$ in automation","Restore the default by clearing the property in config rather than sending a string like 'default'","Verify the applied value via `-reconfig namenode <addr> -status`"],"exampleFix":"# before\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.blockplacementpolicy.min.blocks.for.write=2 blocks\n\n# after\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.blockplacementpolicy.min.blocks.for.write=2","handlingStrategy":"validation","validationCode":"VAL=2\n[[ \"$VAL\" =~ ^[0-9]+$ ]] || { echo \"need plain integer\"; exit 1; }\nhdfs dfsadmin -reconfig namenode nn1:8020 -set dfs.namenode.blockplacementpolicy.min.blocks.for.write=$VAL","typeGuard":"static boolean isPlainInt(String s) {\n  return s != null && s.matches(\"^[0-9]+$\");\n}","tryCatchPattern":"catch (ReconfigurationException e) {\n  if (e.getCause() instanceof IllegalArgumentException) {\n    // non-numeric min-blocks value - reject in the caller's form/UI before retry\n  }\n}","preventionTips":["min.blocks.for.write takes a bare integer count","Validate at the UI or script layer where operators type the value","Prefer runtime reconfig over editing XML for this key - but lint first"],"tags":["hdfs","name-node","reconfig","block-placement","dfsadmin","number-format"],"backgroundTag":"runtime-reconfig-rejected","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}