apache/hadoop · error · InvalidUriAuthorityException
%s has invalid authority.
Error message
%s has invalid authority.
What it means
Thrown by AzureBlobFileSystemStore.authorityParts when the URI's raw authority is null — the store cannot extract filesystem (container) and account names, so initialization aborts with InvalidUriAuthorityException ('<uri> has invalid authority.'). This is the store-level counterpart of the client-side authority check: by the time the store sees the URI, an authority must already be present.
Source
Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:360
} finally {
IOUtils.cleanupWithLogger(LOG, getClientHandler());
}
}
byte[] encodeAttribute(String value) throws UnsupportedEncodingException {
// DFS Client works with ISO_8859_1 encoding, Blob Works with UTF-8.
return getClient().encodeAttribute(value);
}
String decodeAttribute(byte[] value) throws UnsupportedEncodingException {
// DFS Client works with ISO_8859_1 encoding, Blob Works with UTF-8.
return getClient().decodeAttribute(value);
}
private String[] authorityParts(URI uri) throws InvalidUriAuthorityException, InvalidUriException {
final String authority = uri.getRawAuthority();
if (null == authority) {
throw new InvalidUriAuthorityException(uri.toString());
}
if (!authority.contains(AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER)) {
throw new InvalidUriAuthorityException(uri.toString());
}
final String[] authorityParts = authority.split(AbfsHttpConstants.AZURE_DISTRIBUTED_FILE_SYSTEM_AUTHORITY_DELIMITER, 2);
if (authorityParts.length < 2 || authorityParts[0] != null
&& authorityParts[0].isEmpty()) {
final String errMsg = String
.format("'%s' has a malformed authority, expected container name. "
+ "Authority takes the form "
+ FileSystemUriSchemes.ABFS_SCHEME + "://[<container name>@]<account name>",
uri.toString());
throw new InvalidUriException(errMsg);
}
return authorityParts;View on GitHub (pinned to 2add963021)
Solutions
- Always address ABFS paths as abfs://<container>@<account>.dfs.core.windows.net/... .
- Set fs.defaultFS to a fully-qualified abfs URI so relative paths can be qualified.
- Validate uri.getRawAuthority() != null before constructing/opening the filesystem.
Example fix
// before
FileSystem fs = FileSystem.get(new URI("abfs:///"), conf);
// after
FileSystem fs = FileSystem.get(new URI("abfs://data@myaccount.dfs.core.windows.net/"), conf); Defensive patterns
Strategy: validation
Validate before calling
URI u = new URI(fsUrl);
if (u.getRawAuthority() == null) {
throw new IllegalArgumentException("ABFS URI requires container@account authority: " + fsUrl);
}
FileSystem fs = FileSystem.get(u, conf); Type guard
static boolean hasAuthority(URI u) {
return u.getRawAuthority() != null;
} Try / catch
try {
FileSystem.get(uri, conf);
} catch (InvalidUriAuthorityException e) {
throw new ConfigurationException("URI missing authority: " + uri, e);
} Prevention
- Always use fully-qualified abfs:// URIs.
- Set fs.defaultFS so relative qualification never reaches the store authority-less.
- Validate URI shape where URIs enter the system (config loaders, CLI parsers).
When it happens
Trigger: Initializing AzureBlobFileSystemStore with a URI like abfs:///path whose authority is null and from which no default-URI authority was reconstructed.
Common situations: Missing or empty fs.defaultFS; passing a bare Path('/x') to FileSystem.get for the abfs scheme without any authority source; config systems stripping the authority portion of URIs.
Related errors
- {uri} has invalid authority.
- Invalid URI '%s' has a malformed authority, expected contain
- Uri without authority: {uri}
- {uri}
- URL provided is null
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/b7e63595792accd3.
Report an issue: GitHub.