{"record":{"id":"3c99397610104bc0","repo":"apache/hadoop","slug":"unable-to-create-state-store","errorCode":null,"errorMessage":"Unable to create state store","messagePattern":"Unable to create state store","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java","lineNumber":521,"sourceCode":"  }\n\n  private void startStore(Path recoveryRoot) throws IOException {\n    Options options = new Options();\n    options.createIfMissing(false);\n    Path dbPath = new Path(recoveryRoot, STATE_DB_NAME);\n    LOG.info(\"Using state database at \" + dbPath + \" for recovery\");\n    File dbfile = new File(dbPath.toString());\n    try {\n      stateDb = JniDBFactory.factory.open(dbfile, options);\n    } catch (NativeDB.DBException e) {\n      if (e.isNotFound() || e.getMessage().contains(\" does not exist \")) {\n        LOG.info(\"Creating state database at \" + dbfile);\n        options.createIfMissing(true);\n        try {\n          stateDb = JniDBFactory.factory.open(dbfile, options);\n          storeVersion();\n        } catch (DBException dbExc) {\n          throw new IOException(\"Unable to create state store\", dbExc);\n        }\n      } else {\n        throw e;\n      }\n    }\n    checkVersion();\n  }\n  \n  @VisibleForTesting\n  Version loadVersion() throws IOException {\n    byte[] data = stateDb.get(bytes(STATE_DB_SCHEMA_VERSION_KEY));\n    // if version is not stored previously, treat it as CURRENT_VERSION_INFO.\n    if (data == null || data.length == 0) {\n      return getCurrentVersion();\n    }\n    Version version =\n        new VersionPBImpl(VersionProto.parseFrom(data));\n    return version;","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java#L503-L539","documentation":"Error \"Unable to create state store\" thrown in apache/hadoop.","triggerScenarios":"Thrown by ShuffleHandler when it cannot create or open the state store DB for shuffle recovery (e.g. LevelDB fails to initialize in the recovery directory). Check that the recovery directory is writable and not locked by another process.","commonSituations":"See trigger scenarios.","solutions":["Ensure yarn.nodemanager.recovery.dir exists and is writable by the NodeManager user.","Check available disk space and that LevelDB native libraries can load on this platform."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}