{"record":{"id":"6c27b8db4fe1a058","repo":"apache/hadoop","slug":"doesn-t-support-getxattrs","errorCode":null,"errorMessage":"{} doesn't support getXAttrs","messagePattern":"(.+?) doesn't support getXAttrs","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1414,"sourceCode":"    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getXAttr\");\n  }\n\n  /**\n   * Get all of the xattrs for a file or directory.\n   * Only those xattrs for which the logged-in user has permissions to view\n   * are returned.\n   * <p>\n   * Refer to the HDFS extended attributes user documentation for details.\n   *\n   * @param path Path to get extended attributes\n   *\n   * @return {@literal Map<String, byte[]>} describing the XAttrs of the file\n   * or directory\n   * @throws IOException raised on errors performing I/O.\n   */\n  public Map<String, byte[]> getXAttrs(Path path) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getXAttrs\");\n  }\n\n  /**\n   * Get all of the xattrs for a file or directory.\n   * Only those xattrs for which the logged-in user has permissions to view\n   * are returned.\n   * <p>\n   * Refer to the HDFS extended attributes user documentation for details.\n   *\n   * @param path Path to get extended attributes\n   * @param names XAttr names.\n   * @return {@literal Map<String, byte[]>} describing the XAttrs of the file\n   * or directory\n   * @throws IOException raised on errors performing I/O.\n   */\n  public Map<String, byte[]> getXAttrs(Path path, List<String> names)\n      throws IOException {","sourceCodeStart":1396,"sourceCodeEnd":1432,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1396-L1432","documentation":"getXAttrs(path) fetches all extended attributes of a path; like every xattr method, the base AbstractFileSystem has no implementation and throws UnsupportedOperationException with the filesystem's simple class name. Filesystems that persist xattrs (HDFS with dfs.namenode.xattrs.enabled, POSIX-backed locals) override it; 'hadoop fs -getfattr -d' and FileContext.getXAttrs hit the default elsewhere.","triggerScenarios":"fc.getXAttrs(path) on an object store, ftp, or http filesystem; bulk metadata dumps iterating all files in mixed-protocol data lakes; getfattr -d executed against a defaultFS without xattr support.","commonSituations":"Audit/export tools that harvest every xattr from files; frameworks (tagging, encryption markers, lineage) whose readers run on environments backed by S3-compatible stores; local tests on kernel filesystems without user xattrs.","solutions":["Gate the bulk read with fc.hasPathCapability(path, CommonPathCapabilities.FS_XATTRS)","Skip xattr harvesting entirely for stores without the capability rather than failing the job","On HDFS confirm dfs.namenode.xattrs.enabled and expect only visible namespaces (raw.* requires permissions)"],"exampleFix":"// before\nMap<String, byte[]> all = fc.getXAttrs(path); // -> UOE\n\n// after\nMap<String, byte[]> all = fc.hasPathCapability(path,\n        CommonPathCapabilities.FS_XATTRS)\n    ? fc.getXAttrs(path)\n    : Collections.emptyMap();","handlingStrategy":"validation","validationCode":"Map<String, byte[]> all = fc.hasPathCapability(path,\n        CommonPathCapabilities.FS_XATTRS)\n    ? fc.getXAttrs(path)\n    : Collections.emptyMap();","typeGuard":"boolean xattrCapable(Path p) throws IOException {\n  return fc.hasPathCapability(p, CommonPathCapabilities.FS_XATTRS);\n}","tryCatchPattern":"try { return fc.getXAttrs(path); } catch (UnsupportedOperationException e) { return Collections.emptyMap(); }","preventionTips":["Skip bulk xattr harvesting on stores that report no xattr capability","Expect only user.* namespaces to be visible in bulk reads on HDFS","Cache the per-store capability before iterating large listings"],"tags":["xattr","extended-attributes","unsupported-feature","object-store","hadoop-fs"],"backgroundTag":"filesystem-capability-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}