{"record":{"id":"1f86976be889a3a3","repo":"apache/hadoop","slug":"no-store-location-directory-configured-in-mapreduc","errorCode":null,"errorMessage":"No store location directory configured in mapreduce.jobhistory.recovery.store.leveldb.path","messagePattern":"No store location directory configured in mapreduce\\.jobhistory\\.recovery\\.store\\.leveldb\\.path","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryServerLeveldbStateStoreService.java","lineNumber":304,"sourceCode":"      LOG.debug(\"Removing master key \" + masterKey.getKeyId());\n    }\n\n    String dbKey = getTokenMasterKeyDatabaseKey(masterKey);\n    try {\n      db.delete(bytes(dbKey));\n    } catch (DBException e) {\n      throw new IOException(e);\n    }\n  }\n\n  private String getTokenMasterKeyDatabaseKey(DelegationKey masterKey) {\n    return TOKEN_MASTER_KEY_KEY_PREFIX + masterKey.getKeyId();\n  }\n\n  private Path createStorageDir(Configuration conf) throws IOException {\n    String confPath = conf.get(JHAdminConfig.MR_HS_LEVELDB_STATE_STORE_PATH);\n    if (confPath == null) {\n      throw new IOException(\"No store location directory configured in \" +\n          JHAdminConfig.MR_HS_LEVELDB_STATE_STORE_PATH);\n    }\n    Path root = new Path(confPath, DB_NAME);\n    FileSystem fs = FileSystem.getLocal(conf);\n    fs.mkdirs(root, new FsPermission((short)0700));\n    return root;\n  }\n\n  Version loadVersion() throws IOException {\n    byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));\n    // if version is not stored previously, treat it as 1.0.\n    if (data == null || data.length == 0) {\n      return Version.newInstance(1, 0);\n    }\n    Version version =\n        new VersionPBImpl(VersionProto.parseFrom(data));\n    return version;\n  }","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryServerLeveldbStateStoreService.java#L286-L322","documentation":"The LevelDB state store needs a local directory for its database files. createStorageDir reads mapreduce.jobhistory.recovery.store.leveldb.path and throws this IOException when the property is absent. Recovery with the LevelDB store is only functional once a writable local path is configured; note the store uses the local filesystem, not HDFS, and creates the directory with 0700 permissions.","triggerScenarios":"mapreduce.jobhistory.recovery.enable=true with store class HistoryServerLeveldbStateStoreService but no mapreduce.jobhistory.recovery.store.leveldb.path in mapred-site.xml; property name typo; wrong configuration directory loaded.","commonSituations":"Recovery configs copied from documentation without the path property; generated mapred-site.xml dropping the property; fresh HA setup enabling recovery for the first time.","solutions":["Set mapreduce.jobhistory.recovery.store.leveldb.path to a writable local directory in mapred-site.xml (for example /var/lib/hadoop-yarn/jhs-state).","Verify the JHS process user can create and write that directory.","If recovery is not intended, set mapreduce.jobhistory.recovery.enable=false instead.","Reload the configuration and restart the history server."],"exampleFix":"<!-- before: recovery enabled, store location missing -->\n<property>\n  <name>mapreduce.jobhistory.recovery.enable</name>\n  <value>true</value>\n</property>\n\n<!-- after: add the LevelDB store location -->\n<property>\n  <name>mapreduce.jobhistory.recovery.enable</name>\n  <value>true</value>\n</property>\n<property>\n  <name>mapreduce.jobhistory.recovery.store.leveldb.path</name>\n  <value>/var/lib/hadoop-yarn/jhs-state</value>\n</property>","handlingStrategy":"validation","validationCode":"# fail fast before JHS start: recovery enabled requires the leveldb path\nif grep -q 'mapreduce.jobhistory.recovery.enable.*true' /etc/hadoop/conf/mapred-site.xml; then\n  grep -q 'mapreduce.jobhistory.recovery.store.leveldb.path' /etc/hadoop/conf/mapred-site.xml \\\n    || { echo 'MR_HS_LEVELDB_STATE_STORE_PATH missing'; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat recovery enable, store class, and store path as one config unit in templates.","Validate required recovery properties in deployment scripts.","Prefer a dedicated local disk path for the LevelDB store."],"tags":["mapreduce","job-history-server","leveldb","recovery","configuration"],"backgroundTag":"missing-config-property","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}