apache/hadoop · error · UnsupportedOperationException
This operation is only valid for storage accounts with the h
Error message
This operation is only valid for storage accounts with the hierarchical namespace enabled.
What it means
ABFS exposes POSIX ownership only on storage accounts with the hierarchical namespace (HNS/Data Lake Gen2) enabled. setOwner checks getIsNamespaceEnabled() client-side before any REST call and throws UnsupportedOperationException on flat blob accounts - the request never reaches the service.
Source
Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:1477
for (int i = 0; i < base64EncodedToken.length(); i++) {
char current = base64EncodedToken.charAt(i);
if (CHAR_FORWARD_SLASH == current) {
current = CHAR_UNDERSCORE;
} else if (CHAR_PLUS == current) {
current = CHAR_STAR;
} else if (CHAR_EQUALS == current) {
current = CHAR_HYPHEN;
}
encodedTokenBuilder.append(current);
}
return encodedTokenBuilder.toString();
}
public void setOwner(final Path path, final String owner, final String group,
TracingContext tracingContext) throws AzureBlobFileSystemException {
if (!getIsNamespaceEnabled(tracingContext)) {
throw new UnsupportedOperationException(
"This operation is only valid for storage accounts with the hierarchical namespace enabled.");
}
try (AbfsPerfInfo perfInfo = startTracking("setOwner", "setOwner")) {
LOG.debug(
"setOwner filesystem: {} path: {} owner: {} group: {}",
getClient().getFileSystem(),
path,
owner,
group);
final String transformedOwner = identityTransformer.transformUserOrGroupForSetRequest(owner);
final String transformedGroup = identityTransformer.transformUserOrGroupForSetRequest(group);
final AbfsRestOperation op = getClient().setOwner(getRelativePath(path),
transformedOwner,
transformedGroup,View on GitHub (pinned to 2add963021)
Solutions
- Enable Hierarchical Namespace on the account (Azure Portal > storage account > Data Lake Gen2) or move data to an HNS-enabled account, then re-mount.
- Skip the chown step for flat accounts (guard it behind an HNS capability check).
- Verify with 'az storage account show --name <acct> --query isHnsEnabled'.
- Ensure fs.defaultFS points at abfs(s)://container@account.dfs.core.windows.net of the HNS account, not at a blob-endpoint alias.
Example fix
# before hadoop fs -chown newowner:newgroup abfs://c@flatacct.dfs.core.windows.net/data # after - either enable HNS on the account, or skip chown on non-HNS mounts
Defensive patterns
Strategy: try-catch
Validate before calling
if (fs instanceof AzureBlobFileSystem
&& !((AzureBlobFileSystem) fs).getAbfsStore().getIsNamespaceEnabled(null)) {
// skip setOwner - account has no hierarchical namespace
} Try / catch
try { fs.setOwner(path, owner, group); } catch (UnsupportedOperationException e) {
if (e.getMessage().contains("hierarchical namespace")) { /* account is not HNS: skip ownership ops */ }
} Prevention
- Check az storage account show --query isHnsEnabled before scripting chown.
- Gate POSIX metadata operations behind an HNS capability probe.
- Create Gen2 (HNS) accounts wherever POSIX semantics are expected.
When it happens
Trigger: Calling fs.setOwner(path, owner, group) (hadoop fs -chown) on an ABFS mount backed by a non-HNS storage account; also programmatic owner changes from Ranger/privilege sync tooling.
Common situations: Storage account created without the 'Hierarchical namespace' option; wasb workflows migrated to abfs expecting POSIX semantics; chown steps in provisioning scripts run against blob accounts.
Related errors
- SetPermission operation is only supported on HNS enabled Acc
- SetOwner operation is only supported on HNS enabled Accounts
- SetAcl operation is only supported on HNS enabled Accounts.
- GetAclStatus operation is only supported on HNS enabled Acco
- CheckAccess operation is only supported on HNS enabled Accou
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/46e756b040fdbef2.
Report an issue: GitHub.