{"record":{"id":"1f13f5451be358a4","repo":"apache/hadoop","slug":"inmemoryaliasmap-enabled-with-null-location","errorCode":null,"errorMessage":"InMemoryAliasMap enabled with null location","messagePattern":"InMemoryAliasMap enabled with null location","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java","lineNumber":548,"sourceCode":"    @Override\n    public String toString() {\n      return \"AliasMap directory = \" + this.getRoot();\n    }\n  }\n\n  /**\n   * Format, if needed, and download the aliasmap.\n   * @param pathAliasMap the path where the aliasmap should be downloaded.\n   * @param proxyInfo remote namenode to get the aliasmap from.\n   * @return 0 on a successful transfer, and error code otherwise.\n   * @throws IOException\n   */\n  private int formatAndDownloadAliasMap(String pathAliasMap,\n      RemoteNameNodeInfo proxyInfo) throws IOException {\n    LOG.info(\"Bootstrapping the InMemoryAliasMap from \"\n        + proxyInfo.getHttpAddress());\n    if (pathAliasMap == null) {\n      throw new IOException(\"InMemoryAliasMap enabled with null location\");\n    }\n    File aliasMapFile = new File(pathAliasMap);\n    if (aliasMapFile.exists()) {\n      AliasMapStorageDirectory aliasMapSD =\n          new AliasMapStorageDirectory(aliasMapFile);\n      if (!Storage.confirmFormat(\n          Arrays.asList(aliasMapSD), force, interactive)) {\n        return ERR_CODE_ALREADY_FORMATTED;\n      } else {\n        if (!FileUtil.fullyDelete(aliasMapFile)) {\n          throw new IOException(\n              \"Cannot remove current alias map: \" + aliasMapFile);\n        }\n      }\n    }\n\n    // create the aliasmap location.\n    if (!aliasMapFile.mkdirs()) {","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/BootstrapStandby.java#L530-L566","documentation":"BootstrapStandby.parseProvidedConfigurations() enables aliasmap bootstrapping when both dfs.namenode.provided.enabled and dfs.provided.aliasmap.inmemory.enabled are true, then reads the location from dfs.provided.aliasmap.inmemory.leveldb.dir. formatAndDownloadAliasMap() throws IOException when that key is unset, because there is nowhere to download the InMemoryAliasMap to.","triggerScenarios":"'hdfs namenode -bootstrapStandby' with provided storage + in-memory aliasmap enabled but dfs.provided.aliasmap.inmemory.leveldb.dir absent from configuration, so aliasMapPath is null at the download step.","commonSituations":"Provided-storage (HDFS-14952 era) rollout where the active node got the leveldb dir setting but the standby template did not; key renamed/misspelled across releases; aliasmap enabled globally but the standby was expected to use a remote aliasmap.","solutions":["Set dfs.provided.aliasmap.inmemory.leveldb.dir to a local writable path on the standby, matching the active's layout","Or, if the standby should not hold an in-memory aliasmap, disable dfs.provided.aliasmap.inmemory.enabled there","Re-run 'hdfs namenode -bootstrapStandby' after the configuration fix"],"exampleFix":"<!-- before: aliasmap enabled, no location -->\n<property><name>dfs.namenode.provided.enabled</name><value>true</value></property>\n<property><name>dfs.provided.aliasmap.inmemory.enabled</name><value>true</value></property>\n<!-- after: add the leveldb dir -->\n<property><name>dfs.provided.aliasmap.inmemory.leveldb.dir</name><value>/data/dfs/aliasmap/inmemory</value></property>","handlingStrategy":"validation","validationCode":"boolean provided = conf.getBoolean(\"dfs.namenode.provided.enabled\", false);\nboolean aliasmap = conf.getBoolean(\"dfs.provided.aliasmap.inmemory.enabled\", false);\nString dir = conf.get(\"dfs.provided.aliasmap.inmemory.leveldb.dir\");\nif (provided && aliasmap && dir == null) {\n  throw new IOException(\"InMemoryAliasMap enabled but \"\n      + \"dfs.provided.aliasmap.inmemory.leveldb.dir is unset\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  runner.run(argv); // BootstrapStandby with provided storage\n} catch (IOException e) { // \"InMemoryAliasMap enabled with null location\"\n  // config gap: set the leveldb dir (or disable the aliasmap) and re-run\n}","preventionTips":["Treat provided-storage keys as one unit in config templates — enabling two without the third always fails here","Config-lint any node with dfs.namenode.provided.enabled=true for the leveldb.dir key"],"tags":["hdfs","namenode","bootstrap-standby","provided-storage","aliasmap","missing-configuration"],"backgroundTag":"missing-configuration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}