apache/hadoop · error · UnsupportedOperationException

CheckAccess operation is only supported on HNS enabled Accou

Error message

CheckAccess operation is only supported on HNS enabled Accounts.

What it means

AbfsBlobClient.checkAccess is a stub that always throws UnsupportedOperationException('CheckAccess operation is only supported on HNS enabled Accounts.') when the bound account lacks hierarchical namespace. The CheckAccess REST API (rwx permission check) is a DFS/HNS endpoint, so non-HNS accounts have no equivalent and the driver refuses the call without touching the network.

Source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:1491

      TracingContext tracingContext) throws AzureBlobFileSystemException {
    throw new UnsupportedOperationException(
        "GetAclStatus operation is only supported on HNS enabled Accounts.");
  }

  /**
   * Check the access of the file or directory.
   * Not supported for HNS-Disabled Accounts.
   * @param path  Path for which access check needs to be performed
   * @param rwx   The permission to be checked on the path
   * @param tracingContext Tracks identifiers for request header
   * @return exception as this operation is not supported on Blob Endpoint.
   * @throws UnsupportedOperationException always.
   */
  @Override
  public AbfsRestOperation checkAccess(String path,
      String rwx,
      TracingContext tracingContext) throws AzureBlobFileSystemException {
    throw new UnsupportedOperationException(
        "CheckAccess operation is only supported on HNS enabled Accounts.");
  }

  /**
   * Get Rest Operation for API
   * <a href="../../../../site/markdown/blobEndpoint.md#get-block-list">Get Block List</a>.
   * Get the list of committed block ids of the blob.
   * @param path The path to get the list of blockId's.
   * @param tracingContext for tracing the service call.
   * @return executed rest operation containing response from server.
   * @throws AzureBlobFileSystemException if rest operation fails.
   */
  public AbfsRestOperation getBlockList(final String path,
      TracingContext tracingContext) throws AzureBlobFileSystemException {
    final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();

    final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder();
    String operation = SASTokenProvider.READ_OPERATION;

View on GitHub (pinned to 2add963021)

Solutions

  1. Enable Hierarchical Namespace on the account for rwx-style access checks
  2. Replace the preflight with an existence + try-write probe (create/delete a temp entry) on non-HNS accounts
  3. Feature-detect and skip access() for non-HNS filesystems

Example fix

// before
fs.access(path, FsAction.READ_WRITE);

// after
if (isHnsAccount(fs)) {
  fs.access(path, FsAction.READ_WRITE);
} else {
  // probe instead: open for append or create/delete a temp marker
}
Defensive patterns

Strategy: validation

Validate before calling

if (isHnsAccount(fs)) {
  fs.access(path, FsAction.READ_WRITE);
} else {
  probeWritable(fs, path); // create/delete a temp marker instead
}

Type guard

private static boolean supportsAccessCheck(FileSystem fs) {
  return !(fs instanceof AzureBlobFileSystem)
      || fs.getConf().getBoolean("fs.azure.account.hns.enabled", false);
}

Try / catch

try {
  fs.access(path, FsAction.READ_WRITE);
} catch (UnsupportedOperationException e) {
  // non-HNS: fall back to an existence + temp-write probe
}

Prevention

When it happens

Trigger: Calling fs.access(path, FsAction.READ_WRITE) (or the AzureBlobFileSystem checkAccess API) on an abfs:// path whose account has HNS disabled.

Common situations: Job setup calling FileSystem.access() to preflight writability; portable code ported from HDFS; tooling assuming every FileSystem implements access checks with POSIX semantics.

Related errors


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