apache/hadoop · error · IOException
Attributes with name {} are not found.
Error message
Attributes with name {} are not found. What it means
getXAttrs(path, names) throws IOException listing the missing names when the retained result is smaller than the requested list: the batch getter requires every requested xattr (object tag) to exist and reports badNames (the difference) in the message.
Source
Thrown at hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/RawFileSystem.java:734
public byte[] getXAttr(Path path, String name) throws IOException {
Map<String, byte[]> xAttrs = getXAttrs(path);
if (xAttrs.containsKey(name)) {
return xAttrs.get(name);
} else {
throw new IOException("Attribute with name " + name + " is not found.");
}
}
@Override
public Map<String, byte[]> getXAttrs(Path path, List<String> names) throws IOException {
Map<String, byte[]> xAttrs = getXAttrs(path);
xAttrs.keySet().retainAll(names);
if (xAttrs.size() == names.size()) {
return xAttrs;
} else {
List<String> badNames = names.stream().filter(n -> !xAttrs.containsKey(n)).collect(
Collectors.toList());
throw new IOException("Attributes with name " + badNames + " are not found.");
}
}
@Override
public List<String> listXAttrs(Path path) throws IOException {
return Lists.newArrayList(getXAttrs(path).keySet());
}
@Override
public void removeXAttr(Path path, String name) throws IOException {
if (getFileStatus(path).isFile()) {
Path qualifiedPath = path.makeQualified(uri, workingDir);
String key = ObjectUtils.pathToKey(qualifiedPath);
Map<String, String> existedTags = storage.getTags(key);
if (existedTags.remove(name) != null) {
storage.putTags(key, existedTags);
}View on GitHub (pinned to 2add963021)
Solutions
- Request attributes individually or use getXAttrs(path) and filter, treating absent keys as missing
- Backfill the missing tags on objects that should carry them
- Split required vs optional names: batch-get required, individually probe optional
Example fix
// before
Map<String, byte[]> m = fs.getXAttrs(path, Arrays.asList("user.a", "user.b")); // throws if either missing
// after
Map<String, byte[]> m = fs.getXAttrs(path);
for (String want : new String[]{"user.a", "user.b"}) {
byte[] v = m.get(want); // null when absent
} Defensive patterns
Strategy: validation
Validate before calling
Map<String, byte[]> all = fs.getXAttrs(path);
for (String n : wantedNames) {
byte[] v = all.get(n); // tolerate absence per-attribute
} Try / catch
try { m = fs.getXAttrs(path, names); }
catch (IOException e) {
if (e.getMessage() != null && e.getMessage().contains("are not found")) {
// message lists badNames: fall back to per-name gets or backfill tags
} else throw e;
} Prevention
- Batch-get only attributes guaranteed to exist
- Backfill new tags during schema evolution before batch reads
- Split required vs optional attribute requests
When it happens
Trigger: fs.getXAttrs(path, Arrays.asList("user.a", "user.b")) when at least one of the tags is absent; xAttrs.keySet().retainAll(names) drops the missing ones and the size comparison fails.
Common situations: Bulk metadata reads where some objects carry only a subset of tags; schema evolution adding new tags that older objects lack; mixing mandatory and optional attributes in one request.
Related errors
- Attribute with name {} is not found.
- XAttr: {} already exists. The REPLACE flag must be specified
- XAttr: {} does not exist. The CREATE flag must be specified.
- Can't open %s because it is a directory
- {} is a directory
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/d5b4973c3be0bb6c.
Report an issue: GitHub.