apache/hadoop · error · IOException
No store location directory configured in mapreduce.jobhisto
Error message
No store location directory configured in mapreduce.jobhistory.recovery.store.leveldb.path
What it means
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.
Source
Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/HistoryServerLeveldbStateStoreService.java:304
LOG.debug("Removing master key " + masterKey.getKeyId());
}
String dbKey = getTokenMasterKeyDatabaseKey(masterKey);
try {
db.delete(bytes(dbKey));
} catch (DBException e) {
throw new IOException(e);
}
}
private String getTokenMasterKeyDatabaseKey(DelegationKey masterKey) {
return TOKEN_MASTER_KEY_KEY_PREFIX + masterKey.getKeyId();
}
private Path createStorageDir(Configuration conf) throws IOException {
String confPath = conf.get(JHAdminConfig.MR_HS_LEVELDB_STATE_STORE_PATH);
if (confPath == null) {
throw new IOException("No store location directory configured in " +
JHAdminConfig.MR_HS_LEVELDB_STATE_STORE_PATH);
}
Path root = new Path(confPath, DB_NAME);
FileSystem fs = FileSystem.getLocal(conf);
fs.mkdirs(root, new FsPermission((short)0700));
return root;
}
Version loadVersion() throws IOException {
byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
// if version is not stored previously, treat it as 1.0.
if (data == null || data.length == 0) {
return Version.newInstance(1, 0);
}
Version version =
new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}View on GitHub (pinned to 2add963021)
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.
Example fix
<!-- before: recovery enabled, store location missing --> <property> <name>mapreduce.jobhistory.recovery.enable</name> <value>true</value> </property> <!-- after: add the LevelDB store location --> <property> <name>mapreduce.jobhistory.recovery.enable</name> <value>true</value> </property> <property> <name>mapreduce.jobhistory.recovery.store.leveldb.path</name> <value>/var/lib/hadoop-yarn/jhs-state</value> </property>
Defensive patterns
Strategy: validation
Validate before calling
# fail fast before JHS start: recovery enabled requires the leveldb path
if grep -q 'mapreduce.jobhistory.recovery.enable.*true' /etc/hadoop/conf/mapred-site.xml; then
grep -q 'mapreduce.jobhistory.recovery.store.leveldb.path' /etc/hadoop/conf/mapred-site.xml \
|| { echo 'MR_HS_LEVELDB_STATE_STORE_PATH missing'; exit 1; }
fi Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unable to locate storage class, check mapreduce.jobhistory.r
- ${tokenPath} already exists
- ${keyPath} already exists
- Error loading token master key from ${key}
- Error loading token state from ${key}
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/1f86976be889a3a3.
Report an issue: GitHub.