apache/hadoop · error · IOException
ViewFs: Cannot initialize: Invalid entry in Mount table in c
Error message
ViewFs: Cannot initialize: Invalid entry in Mount table in config: {src} What it means
While parsing fs.viewfs.mounttable.<name>.* keys, InodeTree maps each key suffix to a known kind: link., linkNfly., link fallback, linkMerge., linkMergeSlash., linkRegex, homedir. A suffix matching none of them reaches the final else and throws IOException('ViewFs: Cannot initialize: Invalid entry in Mount table in config: <src>') with the raw suffix for easy identification.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/InodeTree.java:690
src = src.substring(Constants.CONFIG_VIEWFS_LINK_NFLY.length() + 1);
// settings.src
settings = src.substring(0, src.indexOf('.'));
// settings
// settings.src
src = src.substring(settings.length() + 1);
// src
linkType = LinkType.NFLY;
} else if (src.startsWith(Constants.CONFIG_VIEWFS_LINK_REGEX)) {
linkEntries.add(
buildLinkRegexEntry(config, ugi, src, si.getValue()));
continue;
} else if (src.startsWith(Constants.CONFIG_VIEWFS_HOMEDIR)) {
// ignore - we set home dir from config
continue;
} else {
throw new IOException("ViewFs: Cannot initialize: Invalid entry in " +
"Mount table in config: " + src);
}
final String target = si.getValue();
if (linkType != LinkType.MERGE_SLASH) {
if (isMergeSlashConfigured) {
throw new IOException("Mount table " + mountTableName
+ " has already been configured with a merge slash link. "
+ "A regular link should not be added.");
}
linkEntries.add(
new LinkEntry(src, target, linkType, settings, ugi, config));
} else {
if (!linkEntries.isEmpty()) {
throw new IOException("Mount table " + mountTableName
+ " has already been configured with regular links. "
+ "A merge slash link should not be configured.");
}View on GitHub (pinned to 2add963021)
Solutions
- Correct the prefix to a supported kind (link., linkMerge., linkMergeSlash., linkNfly., linkRegex, fallback, homedir)
- Remove unrelated properties from under fs.viewfs.mounttable.<name>.
- When the error names a suffix, grep every config source for that suffix to find the offending key
Example fix
<!-- before --> <property><name>fs.viewfs.mounttable.cluster.lnk./data</name> <value>hdfs://nnA/data</value></property> <!-- after --> <property><name>fs.viewfs.mounttable.cluster.link./data</name> <value>hdfs://nnA/data</value></property>
Defensive patterns
Strategy: validation
Validate before calling
static final List<String> VALID_PREFIXES = Arrays.asList(
"link.", "linkMerge.", "linkMergeSlash", "linkNfly.", "linkRegex", "homedir");
static boolean isValidMountKeySuffix(String suffix) {
return VALID_PREFIXES.stream().anyMatch(suffix::startsWith);
} Try / catch
Catch IOException at ViewFileSystem init; the message includes the invalid suffix — grep all configuration sources for that suffix and correct or remove the key.
Prevention
- Spell link. and linkMerge. prefixes exactly
- Do not place unrelated properties under fs.viewfs.mounttable
- Grep configs for typos like lnk. and links. before deploy
When it happens
Trigger: Typos in key prefixes: fs.viewfs.mounttable.X.lnk./data, ...X.links./data, unknown kinds like ...X.mount./data, or stray properties placed under the mounttable prefix.
Common situations: Hand-edited core-site.xml; config generation that drops or doubles the dot; unrelated properties inherited under fs.viewfs.mounttable.<name>.
Related errors
- ViewFs: Non absolute mount name in config:{src}
- Path {nextInode.fullPath} already exists as link
- Path {strB} already exists as dir; cannot create link here
- Unexpected mount table link entry '{key}'. Use linkMergeSlas
- getServerDefaults on empty path is invalid
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6683f32c49740633.
Report an issue: GitHub.