{"record":{"id":"67cf90f59e94a37c","repo":"apache/hadoop","slug":"checkaccess-operation-is-only-supported-on-hns-ena","errorCode":null,"errorMessage":"CheckAccess operation is only supported on HNS enabled Accounts.","messagePattern":"CheckAccess operation is only supported on HNS enabled Accounts\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java","lineNumber":1491,"sourceCode":"      TracingContext tracingContext) throws AzureBlobFileSystemException {\n    throw new UnsupportedOperationException(\n        \"GetAclStatus operation is only supported on HNS enabled Accounts.\");\n  }\n\n  /**\n   * Check the access of the file or directory.\n   * Not supported for HNS-Disabled Accounts.\n   * @param path  Path for which access check needs to be performed\n   * @param rwx   The permission to be checked on the path\n   * @param tracingContext Tracks identifiers for request header\n   * @return exception as this operation is not supported on Blob Endpoint.\n   * @throws UnsupportedOperationException always.\n   */\n  @Override\n  public AbfsRestOperation checkAccess(String path,\n      String rwx,\n      TracingContext tracingContext) throws AzureBlobFileSystemException {\n    throw new UnsupportedOperationException(\n        \"CheckAccess operation is only supported on HNS enabled Accounts.\");\n  }\n\n  /**\n   * Get Rest Operation for API\n   * <a href=\"../../../../site/markdown/blobEndpoint.md#get-block-list\">Get Block List</a>.\n   * Get the list of committed block ids of the blob.\n   * @param path The path to get the list of blockId's.\n   * @param tracingContext for tracing the service call.\n   * @return executed rest operation containing response from server.\n   * @throws AzureBlobFileSystemException if rest operation fails.\n   */\n  public AbfsRestOperation getBlockList(final String path,\n      TracingContext tracingContext) throws AzureBlobFileSystemException {\n    final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();\n\n    final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder();\n    String operation = SASTokenProvider.READ_OPERATION;","sourceCodeStart":1473,"sourceCodeEnd":1509,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L1473-L1509","documentation":"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.","triggerScenarios":"Calling fs.access(path, FsAction.READ_WRITE) (or the AzureBlobFileSystem checkAccess API) on an abfs:// path whose account has HNS disabled.","commonSituations":"Job setup calling FileSystem.access() to preflight writability; portable code ported from HDFS; tooling assuming every FileSystem implements access checks with POSIX semantics.","solutions":["Enable Hierarchical Namespace on the account for rwx-style access checks","Replace the preflight with an existence + try-write probe (create/delete a temp entry) on non-HNS accounts","Feature-detect and skip access() for non-HNS filesystems"],"exampleFix":"// before\nfs.access(path, FsAction.READ_WRITE);\n\n// after\nif (isHnsAccount(fs)) {\n  fs.access(path, FsAction.READ_WRITE);\n} else {\n  // probe instead: open for append or create/delete a temp marker\n}","handlingStrategy":"validation","validationCode":"if (isHnsAccount(fs)) {\n  fs.access(path, FsAction.READ_WRITE);\n} else {\n  probeWritable(fs, path); // create/delete a temp marker instead\n}","typeGuard":"private static boolean supportsAccessCheck(FileSystem fs) {\n  return !(fs instanceof AzureBlobFileSystem)\n      || fs.getConf().getBoolean(\"fs.azure.account.hns.enabled\", false);\n}","tryCatchPattern":"try {\n  fs.access(path, FsAction.READ_WRITE);\n} catch (UnsupportedOperationException e) {\n  // non-HNS: fall back to an existence + temp-write probe\n}","preventionTips":["Do not assume access() works on every FileSystem implementation","Replace access() preflights with write probes on blob endpoints","Enable HNS if POSIX rwx checks are required"],"tags":["azure","abfs","unsupported-operation","hns","access-check"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}