juicedata/juicefs · error · IOException

RangerPermissionChecker for volume: " + volName + " is alrea

Error message

RangerPermissionChecker for volume: " + volName + " is already created, but no instance found.

What it means

RangerPermissionChecker.acquire throws this IOException when runningInstance says the volume has live handles but the pcs map has no checker object — an internally inconsistent state (checker should exist whenever a running instance is registered).

Source

Thrown at sdk/java/src/main/java/io/juicefs/permission/RangerPermissionChecker.java:94

    rangerPlugin.init();
  }

  public static RangerPermissionChecker acquire(String volName, long handle, FileSystem superGroupFileSystem, RangerConfig config) throws IOException {
    synchronized (runningInstance) {
      if (!runningInstance.containsKey(volName)) {
        if (pcs.containsKey(volName)) {
          throw new IOException("RangerPermissionChecker for volume: " + volName + " is already created, but no running instance found.");
        }
        RangerPermissionChecker pc = new RangerPermissionChecker(superGroupFileSystem, config);
        pcs.put(volName, pc);
        Set<Long> handles = new HashSet<>();
        handles.add(handle);
        runningInstance.put(volName, handles);
        return pc;
      } else {
        RangerPermissionChecker pc = pcs.get(volName);
        if (pc == null) {
          throw new IOException("RangerPermissionChecker for volume: " + volName + " is already created, but no instance found.");
        }
        runningInstance.get(volName).add(handle);
        return pc;
      }
    }
  }

  public static void release(String volName, long handle) {
    if (handle <= 0) {
      return;
    }
    synchronized (runningInstance) {
      if (!runningInstance.containsKey(volName)) {
        return;
      }
      Set<Long> handles = runningInstance.get(volName);
      boolean removed = handles.remove(handle);
      if (!removed) {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Only mutate pcs/runningInstance through acquire()/release()
  2. Check for code paths that call pcs.remove without updating runningInstance
  3. Synchronize all access to the shared static maps
  4. Restart the client to reset static state
Defensive patterns

Strategy: try-catch

Try / catch

try {
  pc = RangerPermissionChecker.acquire(volName, handle, fs, config);
} catch (IOException e) {
  if (e.getMessage().contains("is already created, but no instance found")) {
    LOG.error("Checker maps are inconsistent; restart and audit release() paths", e);
  } else throw e;
}

Prevention

When it happens

Trigger: Second acquire for a volName present in runningInstance while pcs.get(volName) returns null — e.g. pcs entry was removed externally or not populated concurrently.

Common situations: Concurrent modification of the static maps outside acquire/release; partial cleanup from error paths; classloader duplication creating separate pcs/runningInstance views in shared state.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/eb9f8053abb1f56f. Report an issue: GitHub.