apache/hadoop · error · IllegalArgumentException

Don't support Quota for storage type : {}

Error message

Don't support Quota for storage type : {}

What it means

Even a non-null StorageType can be ineligible: StorageType.supportTypeQuota() returns !isTransient(), and RAM_DISK is the transient type (in-memory, evicted to DISK). setQuotaByStorageType therefore rejects RAM_DISK client-side with IllegalArgumentException — transient storage cannot carry a quota because its contents are by definition temporary.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java:2682

  }

  /**
   * Sets or resets quotas by storage type for a directory.
   * @see ClientProtocol#setQuota(String, long, long, StorageType)
   */
  void setQuotaByStorageType(String src, StorageType type, long quota)
      throws IOException {
    checkOpen();
    if (quota <= 0 && quota != HdfsConstants.QUOTA_DONT_SET &&
        quota != HdfsConstants.QUOTA_RESET) {
      throw new IllegalArgumentException("Invalid values for quota :" +
          quota);
    }
    if (type == null) {
      throw new IllegalArgumentException("Invalid storage type(null)");
    }
    if (!type.supportTypeQuota()) {
      throw new IllegalArgumentException(
          "Don't support Quota for storage type : " + type.toString());
    }
    try (TraceScope ignored = newPathTraceScope("setQuotaByStorageType", src)) {
      namenode.setQuota(src, HdfsConstants.QUOTA_DONT_SET, quota, type);
    } catch (RemoteException re) {
      throw re.unwrapRemoteException(AccessControlException.class,
          FileNotFoundException.class,
          QuotaByStorageTypeExceededException.class,
          UnresolvedPathException.class,
          SnapshotAccessControlException.class);
    }
  }

  /**
   * set the modification and access time of a file.
   *
   * @see ClientProtocol#setTimes(String, long, long)
   */

View on GitHub (pinned to 2add963021)

Solutions

  1. Filter before calling: apply quotas only where type.supportTypeQuota() is true.
  2. If you genuinely hit it with RAM_DISK, drop the intent — transient storage is not quota-able; manage capacity via dfs.datanode... max ram cache settings instead.
  3. Fix hardcoded type lists that include RAM_DISK.

Example fix

// before
for (StorageType t : StorageType.values()) {
  client.setQuotaByStorageType(dir, t, quota); // throws for RAM_DISK
}

// after
for (StorageType t : StorageType.values()) {
  if (t.supportTypeQuota()) {
    client.setQuotaByStorageType(dir, t, quota);
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if (!type.supportTypeQuota()) {
  // transient type (RAM_DISK): quotas not supported, skip instead of calling
} else {
  client.setQuotaByStorageType(dir, type, quota);
}

Try / catch

catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("Don't support Quota")) {
    // filter this storage type out of the rollout and continue
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling setQuotaByStorageType with StorageType.RAM_DISK directly, or generic tooling that iterates StorageType.values() and applies quotas to every entry without filtering transient types.

Common situations: Cluster-admin scripts that 'normalize' quotas across all storage types; enablement of LAZY_PERSIST/RAM_DISK tiers followed by blanket quota rollout; test matrices sweeping all enum values.

Related errors


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