{"record":{"id":"368ef4475804bc0c","repo":"juicedata/juicefs","slug":"no-matching-attributes-found-for-remove-operation","errorCode":null,"errorMessage":"No matching attributes found for remove operation","messagePattern":"No matching attributes found for remove operation","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java","lineNumber":2093,"sourceCode":"        byte[] arr = new byte[off - last];\n        buf.get(last, arr, 0, arr.length);\n        result.add(new String(arr));\n        last = off + 1;\n      }\n      off++;\n    }\n    return result;\n  }\n\n  @Override\n  public void removeXAttr(Path path, String name) throws IOException {\n    if (needCheckPermission() && !checkPathAccess(path, FsAction.WRITE, \"removeXAttr\")) {\n      superGroupFileSystem.removeXAttr(path, name);\n      return;\n    }\n    int r = lib.jfs_removeXattr(Thread.currentThread().getId(), handle, normalizePath(path), name);\n    if (r == ENOATTR || r == ENODATA) {\n      throw new IOException(\"No matching attributes found for remove operation\");\n    }\n    if (r < 0)\n      throw error(r, path);\n  }\n\n  @Override\n  public void modifyAclEntries(Path path, List<AclEntry> aclSpec) throws IOException {\n    if (needCheckPermission() && !checkOwner(path, \"modifyAclEntries\")) {\n      superGroupFileSystem.modifyAclEntries(path, aclSpec);\n      return;\n    }\n    List<AclEntry> existingEntries = getAllAclEntries(path);\n    List<AclEntry> newAcl = AclTransformation.mergeAclEntries(existingEntries, aclSpec);\n    setAclInternal(path, newAcl);\n  }\n\n  @Override\n  public void removeAclEntries(Path path, List<AclEntry> aclSpec) throws IOException {","sourceCodeStart":2075,"sourceCodeEnd":2111,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java#L2075-L2111","documentation":"Raised in removeXAttr when the C library returns ENOATTR or ENODATA, i.e. the named extended attribute does not exist on the file at the time of removal. It mirrors POSIX behavior where removing a missing xattr is an error rather than a no-op.","triggerScenarios":"Thrown at sdk/java/src/main/java/io/juicefs/JuiceFileSystemImpl.java:2093 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List existing xattrs (getXAttrs) and only remove names that are present","Catch the exception and treat it as success when idempotent removal is desired"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}