apache/hadoop · error · IOException

Unable to create state store

Error message

Unable to create state store

What it means

ShuffleHandler.startStore could not open the LevelDB state database (and the create-if-missing retry also applies only when the DB file is absent); the state store is unavailable.

Solutions

  1. Ensure yarn.nodemanager.recovery.dir exists and is writable by the NodeManager user.
  2. Check available disk space and that LevelDB native libraries can load on this platform.
Defensive patterns

Strategy: fallback

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/3c99397610104bc0. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java:521

  }

  private void startStore(Path recoveryRoot) throws IOException {
    Options options = new Options();
    options.createIfMissing(false);
    Path dbPath = new Path(recoveryRoot, STATE_DB_NAME);
    LOG.info("Using state database at " + dbPath + " for recovery");
    File dbfile = new File(dbPath.toString());
    try {
      stateDb = JniDBFactory.factory.open(dbfile, options);
    } catch (NativeDB.DBException e) {
      if (e.isNotFound() || e.getMessage().contains(" does not exist ")) {
        LOG.info("Creating state database at " + dbfile);
        options.createIfMissing(true);
        try {
          stateDb = JniDBFactory.factory.open(dbfile, options);
          storeVersion();
        } catch (DBException dbExc) {
          throw new IOException("Unable to create state store", dbExc);
        }
      } else {
        throw e;
      }
    }
    checkVersion();
  }
  
  @VisibleForTesting
  Version loadVersion() throws IOException {
    byte[] data = stateDb.get(bytes(STATE_DB_SCHEMA_VERSION_KEY));
    // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
    if (data == null || data.length == 0) {
      return getCurrentVersion();
    }
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;

View on GitHub (pinned to 2add963021)